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

Modify Drawing properties on multiple drawings

12 REPLIES 12
SOLVED
Reply
Message 1 of 13
knj777
9507 Views, 12 Replies

Modify Drawing properties on multiple drawings

Hi All,

I was wondering if someone has a lisp routine or any other idea on how to change "Drawing Properties" (fields via Mtext) on multiple single drawing files?

There are several instances where we would need to take a project to create another one and simply change the title block description.

As of now, we are opening each drawing (there could be hundreds) and modifiying the drawing properties on each drawing to change the customer name and other project descriptions.

These are not attributes, but fields. I've researched alot on here and couldnt find anything.

The drawing is attached.

Thanks in advance!

knj777

12 REPLIES 12
Message 2 of 13
rl_jackson
in reply to: knj777

Not sure if your aware of this or not but once you create drawing properties inside autocad as a custom field that information is also exposed in the drawing properties via windows, simply right-click the drawing-select properties and go to the tab called custom. All the fields will be listed there that are in the drawing. You can change them from there without ever opening the drawing, in fact anyone could at that point.

 

Hope it helps.


Rick Jackson
Survey CAD Technician VI

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 3 of 13
knj777
in reply to: rl_jackson

Hey Thanks, I did not know that. I also have come to realize that we can change these in Vault as well.

Thanks for replying

Message 4 of 13
JohnWilliams4137
in reply to: knj777

How would you change these properties without opening the drawings? When I go to properties through Windows these options are greyed out. As it happens this is what I would expect as I would not want someone clicking on properties and changing things through Windows without knowing what was actually in the drawing. If there is a way to change these properties without opening the drawings then maybe I need to stop inserting drawing information in drawing properties as potentially it could be changed and be meaningless.

Message 5 of 13
JoshChia
in reply to: knj777

Hi,

 

I still couldn't find any answers to this question. This forum is the closest answer I could find to this question, but I would like to also know how can I achieve that without using Vault?

 

"There are several instances where we would need to take a project to create another one and simply change the title block description.

As of now, we are opening each drawing (there could be hundreds) and modifiying the drawing properties on each drawing to change the customer name and other project descriptions.

These are not attributes, but fields. I've researched alot on here and couldnt find anything."

 

 

Let me restructure the question again. What I would like to do is to change the field in the 'Drawing Properties' such as 'Location Code'. But to open drawing properties for each drawing in the same project one at a time is a painful process. Is there a way I could modify these fields all at once for the drawings in a same project?

 

I've been looking around for an answer to this but I'm still struggling 😞 Please help.

 

Thanks,

Josh.

Message 6 of 13
hmsilva
in reply to: JoshChia

Hi Josh,
to change a custom property, using LISP, it's quite easy.

To process multiple dwg's at once, it's easy too.
One possible way is, using a script file (.scr) to call the LISP file, and using Autodesk ScriptPro to process multiple dwg's.

 

Hope that helps
Henrique

EESignature

Message 7 of 13
hmsilva
in reply to: JoshChia

I did remove the code in my previous post, because it had an error, this one, should work as expected...

 

;; Change custom property
;; prop = custom property Name as a string
;; newvalue = New custom property Value as a string
;; usage (ch_info "Location Code" "123-XYZ")
(vl-load-com)
(defun ch_info (prop newvalue / a b proplst suminfo)
  (setq	suminfo	(vla-get-SummaryInfo
		  (vla-get-ActiveDocument (vlax-get-acad-object))
		)
  )
  (if (> (setq n (vla-NumCustomInfo suminfo)) 0)
    (repeat n
      (vla-GetCustomByIndex suminfo (setq n (1- n)) 'a 'b)
      (setq proplst (cons (list n a b) proplst))
    )
  )
  (if (member prop (mapcar 'cadr proplst))
    (vla-SetCustomByKey suminfo prop newvalue)
  )
  (princ)
)

 

Henrique

EESignature

Message 8 of 13
gdefilo
in reply to: JoshChia

Hi Josh,

I'm new here.

 

Recently I had the same problem and I found that in the Express Tools (as in Acad2013), under "File tools" menu, you can find the "Update Drawing Property Data" command.

It runs the Propulate command, which lets you configure the properties you want and update them in a single file or multiple files in a directory.

You can even set a template file ("Template.prp") where to store the properties you need.

 

Quite simple and fast.

 

Hope this helps,

 

Giancarlo

 

Message 9 of 13
JoshChia
in reply to: hmsilva

Hi Henrique,

 

Thanks a lot for your script. I've tried to run it but I'm not sure what to fill in to the prompt in order to achieve what I need to. (Sorry I'm really new to this).

 

I might need some further guide of how to use this script in order to use it, perhaps take changing the Location Code project wide as an example?

 

Cheers,

Josh.

Message 10 of 13
JoshChia
in reply to: gdefilo

Hi Giancarlo,

Thanks for sharing this tool that you've found! I have a feeling this will work but I'm still a few steps away from achieving this.

I had opened up the *.prp file but I can't work out how to store the LOCATION CODE = xxxx in the properties. I wonder if you can shed some lights on this?

Cheers,
Josh.
Message 11 of 13
gdefilo
in reply to: JoshChia

Hi Josh,

I will try to explain briefly.

 

In the .prp file you can store the information you want, starting from an existing file.

For instance: if you have a dwg file with the properties information you like (i.e. LOCATION CODE = xxxx), you can open that file and run the propulate command. Choose the "Edit" option. A main window will open.

Under the Template menu in the main window of the program you will find "Fill from current drawing" option. In the custom tab you should find the new custom properties filled from your dwg file.

Then, you have to save the .prp file in a location you prefer and name it in a recognizible way (something like "Location.code.prp", suppose). Right after that you have to set this setting as your template: under the Template menu, click on "Make active template".

Now, if you want to set the properties saved in the .prp file on a bunch of dwg's, you have to set the Update option at the command line, then set the "other drawings" option, and finally digit the path of the drawings you want to update. Make sure to write it complete of "*.dwg".

After that you will have the option to update the drawings in the subdirectories.

If you do not have a drawing containg the custom properties you like, you can start from scratch , which is quite the same thing: the difference is that you have to set manually the custom properties in the custom tab of the main window.

 

Hope this helps

 

Giancarlo

 

Message 12 of 13

i clicked on properties but i couldnt find the custom tab, i also want to change dwgprops to multiple drawings

Message 13 of 13
M-Alam
in reply to: gdefilo

this is awesome! took one or two tries to figure it out but it worked at the end. 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