AutoCAD Electrical Forum
Welcome to Autodesk’s AutoCAD Electrical Forums. Share your knowledge, ask questions, and explore popular AutoCAD Electrical topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

VBA: Set Descriptions (1, 2, 3) in drawing properties

7 REPLIES 7
Reply
Message 1 of 8
110000474593
1130 Views, 7 Replies

VBA: Set Descriptions (1, 2, 3) in drawing properties

Hello,

 

I have a VBA script for AutoCAD Electrical and I want to write something to the drawing propertie 'Description 1', see picture. But, I can't find out how to acces this specific propertie. I can acces properties like 'Project Code' and 'Sheet'. I can acces those properties with 'IEC_PROJ'  and 'SHEET' in my VBA code (Example: If .TagString = "SHEET" Then). They are members of the 'WD_M' block?!

 

So, can someone please tell me how I can acces the propertie 'Description 1' with a VBA script??

 

Thank you very much.

 

Drawing_Properties.jpg

7 REPLIES 7
Message 2 of 8
testsubject
in reply to: 110000474593

This information resides in the .wdp file.

 

It is not stored in the WD_M block like the other items you mentioned. If you want to modify the DESC# values, you will need to somehow access the .wdp and then force a titleblock update to "push" the data to the drawings.

 

I wrote a .lsp program to comcatentate these values in the drawing which required that I add 3 new attributes to the titleblock for DESC storage. I was thinking about writing a program to access the .wdp and extract the DESC values from the drawing and put them into the .wdp but never got around to it.

 

http://forums.autodesk.com/t5/AutoCAD-Electrical/Concatenating-DD-values-on-a-titleblock/m-p/3517902...

 

Maybe this might help you...



Bob Hanrahan
Ace User since 1998
If this answered your question, please click on "Accept Solution"
Message 3 of 8
110000474593
in reply to: 110000474593

Thank you for your answer and .lsp program.

 

Do you think/know this is the only way to do this? What do you mean with: 'Force a titleblock update'? I mean, which titleblock do I have to update?

 

If I understand you, all the descriptions for each drawing must be stored in the .wdp file? And what about the 'default.wdt'  file?  It is possible to mapping some attributes there isn't it?

Message 4 of 8
testsubject
in reply to: 110000474593

The data from the .wdp does not automatically get inserted into a drawing when the .wdp is editted. YOu have to do a Titleblock update. WHen I say "force" I just mean that whatever program you create will have to do a titleblock update to push the changes to the drawings.

 

I do not use the default. wdt file. I have a WD_TB attribute in each drawing that hold this info.

 

Either format controls how information is sent to the drawing from the project and drawing properties windows.



Bob Hanrahan
Ace User since 1998
If this answered your question, please click on "Accept Solution"
Message 5 of 8
110000474593
in reply to: 110000474593

I've managed to add the descriptions to the drawing properties. In the Autodesk API Reference, section G - Project Management, there is a 'ace_add_dwg_to_project' function. With this function you can set 'Drawing Descriptions'.

Message 6 of 8
testsubject
in reply to: 110000474593

I will definitely have to check that out. I often want to be able to set Rev values on the sheet on a per drawing basis and this sounds like what I need.



Bob Hanrahan
Ace User since 1998
If this answered your question, please click on "Accept Solution"
Message 7 of 8
testsubject
in reply to: testsubject

I misread this. I thought I would be able to add more DESC lines to an existing drawing, not fill in the 3 DESC lines.

 

Back to the drawing board...



Bob Hanrahan
Ace User since 1998
If this answered your question, please click on "Accept Solution"
Message 8 of 8
CAD-ICE
in reply to: 110000474593

Hi there,

I´m not sure what version of ACADE you are using but I think that from version 2011 you can export the drawing settings to an Excel file and edit the description for each drawing and then re-import them back to your project (see attached image) very appreciated feature indeed Smiley Happy

Regards, Gary

 

 

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

Post to forums  

Autodesk Design & Make Report

”Boost