cagorskij Posted January 30 Posted January 30 (edited) (setq ss1 (ssget "_x" '((8 . "Lot Layer")))) (repeat (setq i (sslength ss1)) (setq numlist (cons (ssname ss1 (setq i (1- i))) numlist)) ) (foreach lotnum numlist (setq PT (cdr (assoc 10 (entget lotnum)))) (command "_.-boundary" PT "") ) I am trying to use the boundary/bpoly command to create boundaries around lot numbers, assuming there is either an existing boundary or just some lines that create a closed space around said lot number. This bit of code seems to loop forever though and I'm unsure why Thanks for any help Edited January 30 by cagorskij Quote
GLAVCVS Posted January 30 Posted January 30 Hi I assume the numbers you are talking about are 'TEXT' objects. If this is the case, you need to add a filter to 'ssget' Replace '((8 . "Lot Layer")) ' with '((0 . " TEXT") (8 . "Lot Layer")) ' 1 Quote
GLAVCVS Posted January 30 Posted January 30 In any case: if you use the 'boundary' command and there is no defined boundary around it, it is possible that 'boundary' will take forever and you will get the feeling that it is the code that is failing. But no: your code is FINE 1 Quote
Saxlle Posted January 30 Posted January 30 Also, if the "MTEXT" is, you can select all desired "MTEXT" and from "PROPERTIES" tab, select "Text frame". That is the easiest way to do and make a boundary around text. If the "TEXT" is, you can use a built-in function in CAD "TXT2MTXT", select all "TEXT" entities and convert it in "MTEXT" and than add a frame. 1 1 Quote
BIGAL Posted January 31 Posted January 31 My test and it worked. (setq ss1 (ssget '((0 . "*TEXT")(8 . "0")))) (repeat (setq i (sslength ss1)) (setq PT (cdr (assoc 10 (entget (ssname ss1 (setq i (1- i))))))) (command "bpoly" PT "") ) 1 Quote
cagorskij Posted February 6 Author Posted February 6 Thanks all. For whatever reason it was hanging when I tested, but when a colleague tested it worked just fine. Same code, same .dwg, /shrug The filter is appreciated GLAVCVS If I need the functionality in the future I will keep it in mind Saxlle And the cheeky logic improvement is also appreciated BIGAL Quote
Tomislav Posted Friday at 01:50 PM Posted Friday at 01:50 PM (edited) u can also try TEXTMASK, masktype 3dsolid and when all text selected in properties u set edges to visible Edited Friday at 01:53 PM by Tomislav 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.