Detect Groups

Detect Groups

Anonymous
Not applicable
545 Views
2 Replies
Message 1 of 3

Detect Groups

Anonymous
Not applicable

 

How can I determine if there are any groups in the AutoCad Drawing?

 

To ungroup all (command "ungroup" "all" "Y").

If they don't exist, this crashes...

 

 

0 Likes
Accepted solutions (1)
546 Views
2 Replies
Replies (2)
Message 2 of 3

rkmcswain
Mentor
Mentor

This should work instead

 

(vl-cmdf "._ungroup" "_All")
(while (= 1 (logand (getvar "CMDACTIVE") 1))
  (command "_Y")
)

 

 

 

 

R.K. McSwain     | CADpanacea | on twitter
0 Likes
Message 3 of 3

Anonymous
Not applicable
Accepted solution
I used....

(setq grps (dictsearch (namedobjdict) "ACAD_GROUP"))
(if (cdr (assoc 3 grps))(command "ungroup" "all" "y"))
0 Likes