Artek Posted July 8, 2016 Posted July 8, 2016 Hi! Is there a way to get the FldPtr ID of an attribute value in a block using Autolisp/Vlisp? I got the Object ID and I want to add or deduct a certain number to the attribute value for that Object ID using a field formula that looks something like this after evaluation: %<\AcExpr (%<\_FldPtr 1957237512304>%-0.6096) \f "%lu2%pr2">% I don't know how to get the FldPtr Number (1957237512304 as per the above example) using Autolisp OR is there another way of adding/subtracting a value without having to use the field pointer in the formula and just use the object ID alone like the sample field expression below? %<\AcObjProp Object(%<\_ObjId 140701471296560>%).TextString>% Thanks. Quote
Artek Posted July 9, 2016 Author Posted July 9, 2016 It's ok now. Finally got it in the end. Thanks. Quote
Kycau Posted June 4 Posted June 4 Hi. Can you please explain how you solved the issue? I am struggling now with following task: att1 has to be a result of formula expression, calculated via att2 *att3. And can't get it right. So far, instead of a number (result of att2 *att3), I get a string: "%<\AcExpr (%<att2>%*(%<att3>%)" where att2 and att3 are correct values of respective attributes. Please see the snapshot. Quote
Kycau Posted June 4 Posted June 4 And the code: (strcat "%<\\AcExpr " "(%<\\AcObjProp Object(%<\\_ObjId " (vla-getobjectidstring (vla-get-utility (vla-get-activedocument (vlax-get-acad-object))) (nth (+ 1 memb) stab_dynb_att_obj1_list) :vlax-false) ">%).TextString>%" "*(" "%<\\AcObjProp Object(%<\\_ObjId " (vla-getobjectidstring (vla-get-utility (vla-get-activedocument (vlax-get-acad-object))) (nth (+ 2 memb) stab_dynb_att_obj1_list) :vlax-false) ">%).TextString \\f \"%lu2%pr2\">%)")))) Quote
Kycau Posted June 4 Posted June 4 The code above is almost good. Had a problem with parantheses. Below, a working code: (strcat "%<\\AcExpr " "(%<\\AcObjProp Object(%<\\_ObjId " (vla-getobjectidstring (vla-get-utility (vla-get-activedocument (vlax-get-acad-object))) (nth (+ 1 memb) stab_dynb_att_obj1_list) :vlax-false) ">%).TextString>%" "*(" "%<\\AcObjProp Object(%<\\_ObjId " (vla-getobjectidstring (vla-get-utility (vla-get-activedocument (vlax-get-acad-object))) (nth (+ 2 memb) stab_dynb_att_obj1_list) :vlax-false) ">%).TextString>%)) \\f \"%lu2%pr2\">%") Quote
Recommended Posts
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.