phjlc Posted June 9, 2023 Posted June 9, 2023 Hi, I usually do Levels point as field where as Level of the block is displaying as shown below this is the field expression : %<\AcObjProp Object(%<\_ObjId 2125408804544>%).InsertionPoint \f "%lu2%pt4%pr3">% but this only work on Meters as the unit of the drawing, so the problem occurs when the drawing that I working on is in Milimeters, but I still need to show the levels in Meters, I used the formula here as follow : this is the field expression : %<\AcExpr (%<\_FldPtr 2124231006640>%*.001) \f "%lu2%pr3">% but I notice that this field expression doesn't use Object Id rather, it uses FldPtr, can anyone guide me for creating this so I can apply this in the attribute within a block, my code that concerned this is as follows: (vla-put-textstring Atr1 (strcat "+" "%<\\AcExpr (%<\\_FldPtr " Fldptr1 ">%*.001) \\f ""\"%lu2%pr3""\">%")) ;; Atr1 - Attribute to be placed this field ;; Fldptr1 - Field Pointer Quote
Lee Mac Posted June 9, 2023 Posted June 9, 2023 The field pointer is the pointer to the nested field expression (i.e. in this case, the field expression which returns the insertion point coordinate value), and so the field expression would be constructed as follows: (vla-put-textstring Atr1 (strcat "+" "%<\\AcExpr (%<\\AcObjProp Object(%<\\_ObjId " ObjectID ">%).InsertionPoint \\f \"%pt4\">%*.001) \\f ""\"%lu2%pr3""\">%")) 2 Quote
phjlc Posted June 9, 2023 Author Posted June 9, 2023 It worked perfectly thanks Lee Mac, just one more question, what's the difference between "%pt4" to "%lu2%pt4%pr3", Quote
Lee Mac Posted June 9, 2023 Posted June 9, 2023 32 minutes ago, phjlc said: It worked perfectly thanks Lee Mac, just one more question, what's the difference between "%pt4" to "%lu2%pt4%pr3", You're welcome. %pt4 obtains a specific coordinate value, %lu2 applies units formatting (similar to LUNITS) and %pr3 applies precision formatting (similar to LUPREC). Since formatting is not required prior to multiplication, I omitted these from the nested field expression. 1 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.