wjp3wjp3
9th Dec 2009, 05:49 pm
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:
%<\AcObjProp.16.2 Object(?BlockRefId,1).InsertionPoint \f "%lu4%pt1%pr2">%
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:
%<\AcExpr (0-13) \f "%lu4%pr2">% (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:
%<\AcExpr (0-%<\AcObjProp.16.2 Object(?BlockRefId,1).InsertionPoint \f "%lu4%pt1%pr2">%) \f "%lu4%pr2">%
Any thoughts?
Thanks,
John
The expression for the x coordinate looks like this:
%<\AcObjProp.16.2 Object(?BlockRefId,1).InsertionPoint \f "%lu4%pt1%pr2">%
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:
%<\AcExpr (0-13) \f "%lu4%pr2">% (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:
%<\AcExpr (0-%<\AcObjProp.16.2 Object(?BlockRefId,1).InsertionPoint \f "%lu4%pt1%pr2">%) \f "%lu4%pr2">%
Any thoughts?
Thanks,
John