Author Topic: deleting custom dwgprops  (Read 1200 times)

0 Members and 1 Guest are viewing this topic.

dubb

  • Swamp Rat
  • Posts: 1105
deleting custom dwgprops
« on: February 03, 2017, 05:56:43 PM »
If anybody uses dwgprops, you know that deleting a custom dwgprop doesn't work as it should. Every time I delete a property using the dialog, then use my script to add custom properties. It appends them after a bunch of blank entries. I found this thread
https://www.theswamp.org/index.php?topic=44832.msg500556#msg500556
However I kinda found it difficult to sift through the entire script and couldn't peice it together. Can anyone please help me develop a proper way to remove all of the custom dwgprops.

My code that doesn't quite work
Code: [Select]
(defun drop()
(vl-load-com)
(setq acadObj (vlax-get-acad-object))
(setq acDoc (vlax-get-property acadObj 'ActiveDocument))
(setq acDocSumInfo (vlax-get-property acDoc 'SummaryInfo))
;; Get the number of Custom properties
(setq nCustomProps (vlax-invoke-method acDocSumInfo 'NumCustomInfo))
;; Print Custom Properties if there are any
(if (= nCustomProps 0)
(prompt (strcat "\n\nNo Custom Properties\n"))
(progn
(setq loopCnt 0)
(prompt (strcat "\n\nCustom Properties"))
(repeat nCustomProps
(vlax-invoke-method acDocSumInfo 'RemoveCustomByKey loopCnt 'customFieldName 'fieldValue)
(prompt (strcat "\n " customFieldName ": " fieldValue))
(setq loopCnt (1+ loopCnt))
  )
)
  )
  )

dubb

  • Swamp Rat
  • Posts: 1105
Re: deleting custom dwgprops
« Reply #1 on: February 03, 2017, 06:14:15 PM »
I think I might have confused myself. The propulate command in express tools creates blank entries. While with the dwgprops dialog, I can properly delete all of the properties without blank entries.