I am trying to put a field formula in an attribute value. Basically I have a block that has a attribute called QTY and it is equal to 1. I can get the object property to equal 1 with this expression:
%<\AcObjProp Object(%<\_ObjId #########>%).Textstring>%
The expression above will show a value equal to 1 (as I would expect)
Lets say I have two blocks now and I have the lisp routine combine the field values to get the expression below.
%<\AcObjProp Object(%<\_ObjId #########>%).Textstring>%+%<\AcObjProp Object(%<\_ObjId #########>%).Textstring>%
In the attribute dialog box it will show 1+1 instead of 2. My question is how do I get it to show 2 with out opening the formula box and evaluating it?
I have also tried.
%<\AcExpr(%<\AcObjProp Object(%<\_ObjId #########>%).Textstring>%)+(%<\AcObjProp Object(%<\_ObjId #########>%).Textstring>%)>%
and
%<\AcExpr((%<\AcObjProp Object(%<\_ObjId #########>%).Textstring>%)+(%<\AcObjProp Object(%<\_ObjId #########>%).Textstring>%))>%
Solved! Go to Solution.
Solved by Lee_Mac. Go to Solution.
Use:
(vla-put-textstring <VLA Attribute Object> "%<\\AcExpr %<\\AcObjProp Object(%<\\_ObjId ##########>%).Textstring>% + %<\\AcObjProp Object(%<\\_ObjId ##########>%).Textstring>% >%" )
Note the extra backslashes when used in a LISP expression.
Did that with the formula but I think it is a different issue. I think it is looking for a field pointer or FldPtr which I do not know how to get. See attached image.
;;; this code is adding the string value of all the quantities in the block
(setq NTB:QTY_FIELD (strcat "+" "(%<\\AcObjProp Object(%<\\_ObjId " (itoa (vla-get-objectid NTB:TREE_EA_NORMAL_ATT)) ">%).Textstring>%)" NTB:QTY_FIELD))
;;; this removes the plus sign from the beginning of the string
(setq NTB:QTY_FIELD (vl-string-left-trim "+" NTB:QTY_FIELD))
;;; this adds the string to include an expression for the formula.
(setq NTB:QTY_FIELD (strcat "%<\\AcExpr(" NTB:QTY_FIELD ")>%"))
You are not following the example in my post - you don't need brackets outside of the property fields within the expression field.
Have a look at how I construct the field expression in this program.
That did it. Thanks for the help.
In your opinion, is there a breakpiont for drawing performance and the number of fields that need to updated in a drawing. Have you run into that. I figure a typical drawing would have about a minimum of 500 and probably up to 2000 fields. Just wondering what your thoughts were.
Thanks,
Not being a draftsman (just a programmer), I don't deal with many large drawings, but since fields are only updated on a regen, I would think they would only affect performance during regen, but regeneration is slow for any large drawing, so the difference may not be noticeable.