Hey all,
I am a beginner at LISP and this is a bit out of my league... and I'm trying to create a lisp where I can draw a polyline between 2 points that also places text with the actual distance offset above the line.
I did find this post and thought it was helpful... but alas, I'm not quite catching on..
Any help appreciated.
Thanks!
Christina
@ckako301 wrote:That code works wonderfully also.
However, I am actually looking to override the distance with text that can be input by the user (not the distance from the line for the text itself). I hope that makes sense.
Everything else works great - I even didn't change it back to T 🙂
I really appreciate your help on this!!
Thanks!
Christina
So you want to be prompted for override [or accept the given distance] on every segment?
Try the attached file Christina
@CodyJJackson wrote:
How can you make the text to show up as 1-0 instead of decimal?
[I think stevor may have misunderstood.] If you want 1'-0", you can get that with a different mode number in the (rtos) function, in place of the 2 that makes it decimal [either 3 or 4 will do]. Or if your current Units are set to Engineering or Architectural, with an appropriate precision setting, you can just leave out the two numbers at the end of the (rtos) function that makes the text content -- (rtos (distance ... ...)).
But if by 1-0 you mean feet and inches without the foot mark or inch mark, or if by that you mean the equivalent of 1.0 but using a hyphen instead of a decimal point, that you will need to do with more code, because AutoCAD doesn't have a way to return text strings in that format directly.
In the former case, with the DIMZIN System Variable set to 3, and if the determining length is 12.0 drawing units, here's one way:
Command: (vl-string-subst "" "'" (vl-string-subst "" "\"" (rtos 12.0 4 0)))
returns
"1-0"
and likewise with a 3 instead of that 4. [The 12.0 above is just to match your example -- keep the (distance) function in its place, in whatever version of a routine you're using.]
In the latter case:
Command: (vl-string-subst "-" "." (rtos 1.0 2 1))
returns
"1-0"
I am soory It seems that i am too late .......
can you help me how to determine the text will be among the line & its scale and how to choose the distance between every word ......