TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Shade on March 08, 2006, 11:53:43 AM
-
I am trying to get input from a user by generating a polyline, and then getting the area from that polyline which will then be placed at the end of a leader.
The following is a bit of the code i am currently using;
(setq PWDT (getvar "PLINEWID"))
(setvar "PLINEWID" 1.25)
(command "_.Pline" pause)
(setq ENT (entlast))
(command "_.Area" ENT)
The problem is autocad try’s to find the area before the polyine command is executed, so therefore no object is stored in the ENT variable, thereby giving my no area.
I would like the program to draw the polyline and keep it but also give me the area when done.
I have fiddle with the idea of collecting points, but that still doesn't graphically show my end user the polyline outline as he is drawing it. Which is what I wish to accomplish.
Any ideas on how I may accomplish my task.
Thanks in advance
:-D
-
(command "_.pline")
(while (> (getvar "cmdactive") 0)
(command pause)
)
(command "")
This should draw a pline as long as you want.
-
You might now need the last
(command "")
I think you would need that if you are processing points from a list, but you can test it and see if you need it or not. If it repeats the pline command, then you don't. :angel:
-
Thank you, works like a charm.
:-D