Jump to content

Recommended Posts

Posted

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.

Posted

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?

Posted
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] )

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

Posted

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.

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