ILoveMadoka Posted March 30, 2023 Posted March 30, 2023 My desire was to simply delete all custom properties regardless of name or order or information. I found this code here (setq sinfo (vla-get-SummaryInfo (vla-get-ActiveDocument (vlax-get-acad-object)))) ;; remove custom infos (repeat (setq n (vla-NumCustomInfo sinfo)) (vla-RemoveCustomByIndex sinfo (setq n (1- n))) ) (foreach prop '(Author Comments Hyperlinkbase Keywords LastSavedBy RevisionNumber Subject Title ) (if (vlax-property-available-p sinfo prop T) (vlax-put-property sinfo prop "") ) ) It does eventually delete all the custom properties but it opens the drawing properties dialog first then opens the purge dialog 3 times (in the current dwg). Can some please help me clean this up such that it only deletes all the custom properties without all the annoying extras? My desire is a (defun c:xxx that I can run clean. Does the (foreach prop above relate to specific property names? I do not have those specific properties per se Quote
ronjonp Posted March 30, 2023 Posted March 30, 2023 No where in that code is PURGE used? I just tried it here and it works without any popups. You should have the (foreach prop .. Quote
ILoveMadoka Posted March 30, 2023 Author Posted March 30, 2023 I have no idea. Purge was not in my history either... In the meantime I came up with this... (works for me) (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) ) Quote
ILoveMadoka Posted March 30, 2023 Author Posted March 30, 2023 (edited) I have found <personally> that sometimes when I paste code in at the command line that I get weirdness.. I should have put into in a file and then try loading it.. any way I'm good. Edited March 30, 2023 by ILoveMadoka Quote
devitg Posted March 30, 2023 Posted March 30, 2023 5 minutes ago, ILoveMadoka said: I have found <personally> that sometimes when I paste code in at the command line that I get weirdness.. I should have put into in a file and then try loading it.. @ILoveMadoka if you use VLIDE from ACAD, you can LOAD to test as many program lines 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.