Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

is there an easy way to delete the custom dwg properties?

5 REPLIES 5
Reply
Message 1 of 6
Anonymous
998 Views, 5 Replies

is there an easy way to delete the custom dwg properties?

currently i use this to remove what is there

but lets say that the field is something random other then "amdtfiletype"
without going into the dwgprops is there an easy way to delete all the
fields in the custom properties?

(if (vl-catch-all-apply
'vla-removecustombykey
(list dwgprops "AmdtFileType")
)
(vla-addcustominfo dwgprops "")

)
5 REPLIES 5
Message 2 of 6
EC-CAD
in reply to: Anonymous

Here's one that sets the values to " "

(defun ClearCustomInfo (/ Info Num)

(vl-load-com)

(setq *acad* (vlax-get-acad-object))

(setq *doc* (vlax-get *acad* 'ActiveDocument))

(vlax-property-available-p *doc* 'SummaryInfo)

(setq Info (vlax-get *doc* 'SummaryInfo))

(setq Num (vla-NumCustomInfo Info))

(while (< Num 11)

(vla-AddCustomInfo Info " " " ")

(setq Info (vlax-get *doc* 'SummaryInfo))

(setq Num (vla-NumCustomInfo Info))

);while

(setq Idex 0)

(repeat 10

(vla-SetCustomByIndex Info Idex " " " ")

(setq Idex (+ Idex 1))

); repeat

);defun



Bob
Message 3 of 6
Anonymous
in reply to: Anonymous


Bob,

thanks for the reply

however when i load it i get

 

Loading...; error: too few actual
parameters


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Here's
one that sets the values to " "

(defun ClearCustomInfo (/ Info
Num)

(vl-load-com)

(setq *acad*
(vlax-get-acad-object))

(setq *doc* (vlax-get *acad*
'ActiveDocument))

(vlax-property-available-p *doc*
'SummaryInfo)

(setq Info (vlax-get *doc* 'SummaryInfo))

(setq
Num (vla-NumCustomInfo Info))

(while (< Num
11)

(vla-AddCustomInfo Info " " " ")

(setq Info (vlax-get *doc*
'SummaryInfo))

(setq Num (vla-NumCustomInfo
Info))

);while

(setq Idex 0)

(repeat
10

(vla-SetCustomByIndex Info Idex " " " ")

(setq Idex (+ Idex
1))

);
repeat

);defun



Bob
Message 4 of 6
richard.harris
in reply to: Anonymous

I know this is not in answer to your post but i'm trying to add custom properties to my drawings. i've searched but was not able to find how to do this. The problem i'm having is that i'm unable to insert the custom props with the block, i'm using the custom props as fields. those custom props are not brought in with the block. if i can add these props in it would be a big help.
Message 5 of 6
scot-65
in reply to: Anonymous

The custom props can only be carried in by using Qnew or equal. It cannot be brought in by using Insert.
So, open up the file that has the custom props, insert your drawing, exploded, and saveas the insert name.

Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.


Message 6 of 6
richard.harris
in reply to: Anonymous

Intresting, I did not even think about going that route thank you.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost