Jump to content

Recommended Posts

Posted

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.

Posted

It's ok now. Finally got it in the end. Thanks.

  • 8 years later...
Posted

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.
 

Screenshot 2025-06-04 182420.png

Posted

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\">%)"))))

 

Posted

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\">%")

 

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...