Aftertouch Posted January 21 Posted January 21 Hello all, I got a LISP that allows users to select a polyline, and that boundary is used to manipulate some entities. Now, i got a question if it is possible to have an option to allow a user to draw a polyline during the LISP execution. So, to make the INITGET function and such aint the problem, but..... Is it possible to call the POLYLINE command, and 'pause' until the user closes that polyline, and then do something with that polyline? So.. the PLINE command is executed, and when finished, use (setq ensel (entlast)), so i can do anything with the ensel symbol? I manage to 'pause' the command to ask for use imput, but allow multiple points to be selected and 'close'... is next level. Quote
marko_ribar Posted January 21 Posted January 21 Of course... (prompt "\nCommand PLINE is activated and you can pick points - to finish - type \"C\" for closing it, or ENTER to leave LWPOLYLINE open...") (command "_.pline") (while (< 0 (getvar (quote cmdactive))) (command "\\") ) Another variant, by using (vl-cmdf) function... (prompt "\nCommand PLINE is activated and you can pick points - to finish - type \"C\" for closing it, or ENTER to leave LWPOLYLINE open...") (vl-cmdf "_.pline") (while (< 0 (getvar (quote cmdactive))) (vl-cmdf "\\") ) Note that this snippet won't work with (command-s) function... Quote
Aftertouch Posted January 22 Author Posted January 22 @marko_ribar Thanks Marko, this works very well! I never used the 'cmdactive' function before. 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.