p7q Posted Friday at 11:05 AM Posted Friday at 11:05 AM Hello everybody, I need a selection set for flatten command. but ı have a list what include entity. So ı think to convert list to selection set. (setq objList '()) (while .... (if ... (setq objList (append (list obj) objList)) ) ) (setq selSet (ssadd)) (foreach ent objList (ssadd ent selSet) ) I used to this code but now not working. Where ı make a mistake? Can u help me? Quote
GLAVCVS Posted Friday at 12:36 PM Posted Friday at 12:36 PM Hi Without first knowing what's in 'objlist', it's difficult to know why its entities aren't included in the set. It's essential to know what the previous 'while' process is. In principle, if 'objlist' is a list of entity names, the code should work. Quote
GLAVCVS Posted Friday at 12:38 PM Posted Friday at 12:38 PM So: make sure 'objlist' is a list of entity names Quote
p7q Posted Monday at 07:07 AM Author Posted Monday at 07:07 AM On 4/4/2025 at 12:36 PM, GLAVCVS said: Hi Without first knowing what's in 'objlist', it's difficult to know why its entities aren't included in the set. It's essential to know what the previous 'while' process is. In principle, if 'objlist' is a list of entity names, the code should work. Expand here it is. Quote
GLAVCVS Posted Monday at 07:30 AM Posted Monday at 07:30 AM Then it should work. The only explanation should be in the part of your code that isn't visible from the 'while' loop. Quote
p7q Posted Monday at 07:48 AM Author Posted Monday at 07:48 AM I solved it now. The problem is that you do not use (sssetfirst nil ss) after (setq ss (ssget)) . Thank you for your interest @GLAVCVS Quote
p7q Posted yesterday at 02:28 PM Author Posted yesterday at 02:28 PM On 4/7/2025 at 8:16 AM, GLAVCVS said: Expand I saw that it happened but it didn't happen again today and I can't find it. Could you please look again? (foreach ennt inBlock (setq entType (cdr (assoc 0 (entget ennt)))) (setq entName (cdr (assoc -1 (entget ennt)))) (if (member entType '("CIRCLE" "ARC" "ELLIPSE" "REGION")) (progn (ssadd ennt ssel) (ssadd entName ssel) ) (SetZZero ennt) ) ) Quote
GLAVCVS Posted 23 hours ago Posted 23 hours ago Assuming 'inBlock' is a list of non-VLA objects, it seems like it should work. The only thing is: 'ennt' and 'entName' are redundant. That is, you're trying to include the same object twice in the set. Quote
p7q Posted 23 hours ago Author Posted 23 hours ago (edited) I wanted to try both versions because I wanted to see the real version but neither one works Edited 2 hours ago by p7q 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.