AutoCAD Electrical General Discussion

Reply
Active Contributor
110000474593
Posts: 29
Registered: ‎09-24-2012
Message 1 of 8 (503 Views)

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

503 Views, 7 Replies
09-24-2012 04:42 AM

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

*Expert Elite*
testsubject
Posts: 1,077
Registered: ‎03-09-2004
Message 2 of 8 (494 Views)

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

09-24-2012 06:17 AM 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
Active Contributor
110000474593
Posts: 29
Registered: ‎09-24-2012
Message 3 of 8 (474 Views)

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

09-24-2012 11:31 PM 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?

*Expert Elite*
testsubject
Posts: 1,077
Registered: ‎03-09-2004
Message 4 of 8 (460 Views)

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

09-25-2012 06:11 AM 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
Active Contributor
110000474593
Posts: 29
Registered: ‎09-24-2012
Message 5 of 8 (414 Views)

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

10-01-2012 04:16 AM 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'.

*Expert Elite*
testsubject
Posts: 1,077
Registered: ‎03-09-2004
Message 6 of 8 (409 Views)

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

10-01-2012 06:41 AM 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
*Expert Elite*
testsubject
Posts: 1,077
Registered: ‎03-09-2004
Message 7 of 8 (401 Views)

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

10-01-2012 12:17 PM 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
Distinguished Contributor
CAD-ICE
Posts: 291
Registered: ‎02-21-2009
Message 8 of 8 (394 Views)

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

10-01-2012 01:28 PM 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 :smileyhappy:

Regards, Gary

 

 

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Manufacturing Community
The Manufacturing Community provides additional access to tips, tutorials, blogs and networking with peers.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

New AutoCAD Electrical Category!

The AutoCAD Electrical forum has moved into it's very own category page, and can no longer be found within the Additional Product Forums.

Ask the Community