Lisp Routine Troubles

Lisp Routine Troubles

efaillaceW9L2E
Contributor Contributor
510 Views
3 Replies
Message 1 of 4

Lisp Routine Troubles

efaillaceW9L2E
Contributor
Contributor

I am trying to use a lisp routine to dimension the total length of a polyline and the dimension line will follow the polyline. I've found things online that I could use and made changes so it will fit my standards. I am having two issues though printing the dimension text and the layer. There should be two lines of text stacked underneath of each other but for some reason, the text is staggered. Also, the command puts everything on the correct layer except the dimension line itself. The pictures attached shown my current result and what I want. Any help would be appreciated. Thanks.

 

 

0 Likes
511 Views
3 Replies
Replies (3)
Message 2 of 4

Sea-Haven
Mentor
Mentor

A lot of code for me offset pline get co-ords. The end leaders are easy as you can get the angle of 2 points or if its curved get 1st derivative of the ends so can work out leader angles. I think it would make the code much shorter. A defun you need is Mtext readable so text does not go upside down. Hint Mtext.

0 Likes
Message 3 of 4

pbejse
Mentor
Mentor

The simplest way to do that is to use MTEXT instead of TEXT and add  "_Layer" "_Current" to the command line syntax.

 

This is will fail  (setvar "CLAYER" "Dims") if "Dims" layer does not exist.

; error: AutoCAD variable setting rejected: "CLAYER" "Dims"

So make sure it does exist . or include test 

(tblsearch "Layer" "Dims")

If not create one ( not included on the modified lisp )

 

Refer to attached file [ dimcurveAF.lsp ]

HTH

 

0 Likes
Message 4 of 4

marko_ribar
Advisor
Advisor
0 Likes