sjaviergmanso Posted May 31, 2023 Posted May 31, 2023 Hi guys, I would like to create a AutoLISP but I am still very new to it and I believe I need a lot of time, perhaps you can help? I need to create create regions out of polylines and allocate these new regions into the layer of the polylines it was created from. The region command does the first step but it allocates all the new region in the same layers so I am trying to make the process quicker not do go one-by-one. Could anyone help? Regards, Quote
marko_ribar Posted May 31, 2023 Posted May 31, 2023 Untested, but it should work... (defun c:polys2regs ( / ss i poly lay reg regx) (if (setq ss (ssget "_:L" '((0 . "*POLYLINE") (-4 . "&=") (70 . 1)))) (repeat (setq i (sslength ss)) (setq poly (ssname ss (setq i (1- i)))) (setq lay (cdr (assoc 8 (entget poly)))) (if command-s (command-s "_.REGION" poly "") (vl-cmdf "_.REGION" poly "") ) (setq reg (entlast)) (entupd (cdr (assoc -1 (entmod (subst (cons 8 lay) (assoc 8 (setq regx (entget reg))) regx))))) ) ) (princ) ) HTH. M.R. 1 Quote
sjaviergmanso Posted June 1, 2023 Author Posted June 1, 2023 That is awesome so quick and it works perfectly! @marko_ribar Thanks a lot for your help! J 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.