fillbear Posted May 31, 2018 Posted May 31, 2018 Hi, help me, please. I need lisp routine for insertion slope of the line in field (text, mtext, attribute, mleader or dim). Steps: 1. Select object "Line". 2. Get Object Id. 3. Create field with formula: abs((delta y)/(delta x)) with conversion factor [0.2]. 4. Set text height (by default 250). 5. Put text object in drawing or ask for object (text, mtext, attribute, mleader or linear dimension, like Lee Mac’s "LengthField"). 6. Repeat steps 1-5 or exit. Field code: %%).Delta \f "%pt2">%/%%).Delta \f "%pt1">%)) \f "%lu2%pr3%ds44%ct8[0.2]">% Sorry, I'm very bad at speaking English. I am hope for your help. Quote
fillbear Posted June 1, 2018 Author Posted June 1, 2018 Sorry, this is not what I need. It's too complicated. If I already have "Object Id", then how to write a function "strcat" correctly with my field? Quote
BIGAL Posted June 1, 2018 Posted June 1, 2018 Go to http://www.lee-mac.com and ahve a look at some of his field code eg Label Area. Quote
hanhphuc Posted June 1, 2018 Posted June 1, 2018 Sorry, this is not what I need. It's too complicated.If I already have "Object Id", then how to write a function "strcat" correctly with my field? this is merely a string substitute example - for testing your field expression (setq id "[color="purple"]2123776032[/color]") [color="green"]; assumed is your "object Id" or (setq id (itoa (vla-get-objectId obj))) [/color] (setq str (getstring t "[color="purple"]\nPaste field expression here : [/color]" )) ([color="blue"]vl-string-subst[/color] [b]id[/b] "[color="purple"]xxxxxxxxxx[/color]" [b]str[/b] ) Quote
Lee Mac Posted June 1, 2018 Posted June 1, 2018 If I already have "Object Id", then how to write a function "strcat" correctly with my field? Use the functions from lines 429-478 of the code for this program in the following way: (strcat "%<\\AcExpr (abs (%<\\AcObjProp Object(%<\\_ObjId " (LM:objectid <your-vla-object>) ">%).Delta \\f \"%pt2\">%/%<\\AcObjProp Object(%<\\_ObjId " (LM:objectid <your-vla-object>) ">%).Delta \\f \"%pt1\">%)) \\f \"%lu2%pr3%ds44%ct8[0.2]\">%" ) Quote
fillbear Posted June 1, 2018 Author Posted June 1, 2018 Thank you, Great Lee Mac. I'm trying, but... I'm very dumb. Very. If you could write the full code, then my joy would be absolute. I really hope for your help. Thanks again. 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.