Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove Group LISP 1

Status
Not open for further replies.

crystalrae

New member
Dec 13, 2000
54
Does anyone know of a LISP that will delete all groups from a drawing. I don't want to delete the enities of the group - but just want to get rid of the grouping without having to manually delete each grouped object (hope that makes sense)

Thanks!
 
Replies continue below

Recommended for you

By groups do you mean blocks?
 
No - they aren't blocks exactly - they are a named selection set of objects - they act almost as blocks but they are able to be edited.
 
;Disband - a command to disband all Groups in a Drawing
;without destroying their member elements
;Please post debugging results
;written by Dr. Tigrek
;
(defun C:Disband()
(setq objdict (namedobjdict))
(setq grpdict (dictsearch objdict "ACAD_GROUP"))

(IF (setq SONNY (dxf 3 grpdict))
(princ "\nGroups and Bands Found in County - and disbanded:")
(princ "\nCounty clean of Groups and Bands")
)
(princ "\n")
(while (setq grpdict (member (assoc 3 grpdict) grpdict))
(princ "\n")
(princ (setq GroupName (cdr (car grpdict))))

(setq GroupEDNA (cdr (assoc 350 grpdict)))

(entdel GroupEDNA)
(setq grpdict (cdr grpdict))

)

(princ)
)
 
Thanks for the LISP. Can you tell me what this means?

Command:
Command: DISBAND
; error: no function definition: DXF

Command:

This was copied from the command line after I ran the program.
 
Please add the following function definition to the lsp file after the end of the function disband.
Thanks for the debug feedback.

(defun dxf (n ed) (cdr (assoc n ed)))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor