Jump to content

Recommended Posts

Posted (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 by cagorskij
Posted

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")) '

Posted

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

Posted

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...