Delete all user defined properties

Delete all user defined properties

Uwe_Lindner
Collaborator Collaborator
245 Views
2 Replies
Message 1 of 3

Delete all user defined properties

Uwe_Lindner
Collaborator
Collaborator

Dear forum, we are looking for a way (e.g. using a Lisp routine) to delete all user-defined properties in an open AutoCAD file.
Is there a way to do this?
We haven't found a standard function for this in AutoCAD.

We therefore hope that this is possible with an LSP routine.
Thank you very much!

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

Moshe-A
Mentor
Mentor

@Uwe_Lindner  hi,

 

AutoCAD file can contain hundreds (or much beyond) of custom user defined properties such as:

blocks

layers

linetypes

dimension styles

text styles

and more...

 

instead of clearing all that you can start a new drawing base on a template.

 

Moshe

 

 

 

0 Likes
Message 3 of 3

DGCSCAD
Collaborator
Collaborator
Accepted solution

If you mean Drawing Properties -> Custom...

 

Solution from here: https://www.cadtutor.net/forum/topic/77226-delete-all-custom-properties-help/#google_vignette

 

 

(defun C:DCF (/ App Doc DwgProps)
  ;;; Delete all Custom Fields
  (setq App (vlax-get-acad-object)
        Doc (vla-get-ActiveDocument App)
        DwgProps (vla-get-SummaryInfo Doc))

  (repeat 
    (setq n (vla-NumCustomInfo DwgProps))
    (vla-RemoveCustomByIndex DwgProps (setq n (1- n)))
  )

  (princ)
)

 

 

AutoCad 2018 (full)
Win 11 Pro
0 Likes