loudy000 Posted October 3, 2018 Posted October 3, 2018 (Defun c:ld (/ ent sset cnt ) (setq sset (ssget)) (setq cnt 0) (repeat (sslength sset) (command "_MAPCreateFeatureFromGeometry" "yes" "landuse" ""))) Hi Guys, sorry this might be so simple but i cant get it to work, basically i need to loop or repeat the command until i hit escape. Thanks for your help. Quote
BIGAL Posted October 3, 2018 Posted October 3, 2018 You need a test after the geometry line you can crash out using a (exit) but this is not ideal better way is to use a (setq x (sslength sset)) so if want exit set x actual sslength+1 of sset and use a While to test. (while (< x Y) etc Quote
loudy000 Posted October 4, 2018 Author Posted October 4, 2018 hi bigal can you give an example i cannot get it to work thanks Quote
ronjonp Posted October 4, 2018 Posted October 4, 2018 (edited) Don't know what that command does but this is a simple while loop: (while (setq s (ssget)) (sssetfirst nil s) (command "_MAPCreateFeatureFromGeometry" "yes" "landuse" "") ) Edited October 4, 2018 by ronjonp 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.