Formula (composed) field expression is not being evaluated.

Formula (composed) field expression is not being evaluated.

varg.zaugg
Contributor Contributor
505 Views
3 Replies
Message 1 of 4

Formula (composed) field expression is not being evaluated.

varg.zaugg
Contributor
Contributor

A field exression as formula, adding two decimals is not being evaluated when copied to an attribute or text. An example:

 

%<\AcExpr (%<\_FldPtr 3064644751888>% + %<\_FldPtr 3064644752208>%) \f "%lu2%ct8[0.01]">%


There is always an "####". Why is it so? One of the values is a BlockPlaceholder. Maybe it is the reason? However, defining the formula via the gui works fine. But when copying and pasting the field expression, it fails to evaluate.

 

I am writing a lisp routine to copy field expressions to other attributes which works well for single, not formula calculated values. Any help is appreciated.

 

(By the way. I don't know how to remove this post from the Dynamic-Blocks-Forum, posting it there beforehand unintended...)

0 Likes
Accepted solutions (1)
506 Views
3 Replies
Replies (3)
Message 2 of 4

pbejse
Mentor
Mentor
Accepted solution

@varg.zaugg wrote:

There is always an "####". Why is it so? One of the values is a BlockPlaceholder. Maybe it is the reason? However, defining the formula via the gui works fine. But when copying and pasting the field expression, it fails to evaluate.

 

I am writing a lisp routine to copy field expressions to other attributes which works well for single, not formula calculated values. Any help is appreciated.


The "####" denotes a broken link, those numbers 3064644751888 and 3064644752208 represents ObjectID. If you copy the attributed block together with the source objects. the link will remain intact but will now be for the new copied objects.

 

if you use this..

 

(vla-put-TextString
  (vlax-ename->vla-object (Car (nentsel)))
  "%<\\AcExpr (%<\\AcObjProp Object(%<\\_ObjId 1675865627536>%).TextString>% +%<\\AcObjProp Object(%<\\_ObjId 1675865627712>%).TextString>%) \\f \"%lu2%pr2\">%"
)

 

Then it should work

Notice the escape characters "\\"?

 

Where you at so far with the lisp, post the code when you're done and we will check it together.

 

Message 3 of 4

varg.zaugg
Contributor
Contributor

Very, vary late here... anyway, thank you so much for this! Best 🙂

0 Likes
Message 4 of 4

Sea-Haven
Mentor
Mentor

Adding two seperate block attributes but put field in 3rd block, as example, need to look at your code, you need to make sure you are say using nentsel a object so get correct ID each time. using copy may not give correct result.

0 Likes