Jump to content

Creating an Absolute Value in a Field Expression


wjp3wjp3

Recommended Posts

I have created blocks for reporting x & y coordinates as ordinate dimensions on our drawings. These use field expressions embedded in the fields within the block definition that report the coordinate points of the insertion points of the blocks.

 

The expression for the x coordinate looks like this:

 

%%

 

Is there a way to write this formula so that it reports an absolute value all of the time (e.g. if x=-12'-3" the attribute would read 12'-3")?

 

If not I can create two separate blocks - one for positive values and one for negative values and use an expression to negate the value of the negative one. However I am also having trouble getting this to work. The expression below works in reporting a simple subtraction:

 

%% (this returns -1'-1" in the attribute, which is what I would expect).

 

However when I substitute the expression for the x coordinate for the number 13 above the formula does not evaluate and I get "########" instead. Below is the expression that I am using:

 

%%) \f "%lu4%pr2">%

 

Any thoughts?

 

Thanks,

 

John

Link to comment
Share on other sites

OK I figured out what I was doing wrong. For the expression to evaluate, the x coordinate of the insertion point needs to be unitless. This is the correct expression for the x coordinate:

 

%%

 

-John

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...