AutoCAD Electrical General Discussion

AutoCAD Electrical General Discussion

Reply
Active Member
mskanth
Posts: 8
Registered: ‎04-02-2009
Message 1 of 4 (240 Views)

updating title block using vba

240 Views, 3 Replies
10-04-2009 05:22 PM
Could anyone help me out on how i can do the title block update using vba code.
I could do it through menu, but i am planning on automating.
Contributor
RealSoftwareSolutions
Posts: 18
Registered: ‎10-29-2009
Message 2 of 4 (240 Views)

Re: updating title block using vba

11-23-2009 11:44 AM in reply to: mskanth
Good day,
There is an API call in the AutoLISP Reference guide that might help. This is to process one drawing at a time but you could script it to make it work for what you are trying to do.

(c:wd_tb_process_one suppress togglelst) - which is located under Section E - Drawing Setup of the AutoCAD Electrical AutoLISP Reference supplied with autoCAD Electrical.

The togglelst includes a list of several items and the refers to what you have the title block setup mapped to. You basically turn the bits on or off. Here is the entire snipit from the help file.

AutoLISP
(c:wd_tb_process_one suppress togglelst)
Parameters
Parameters Description
suppress 1 to suppress any error alert boxes, 0 to allow.
togglelst list of update toggle flags consisting of a 13-element sublist and then followed by a variable length list of LINEn index numbers. First sublist (of 16 elements, 1 for selected, 0 for not selected), described below. After this sublist, give the integer values of the "LINEn" index numbers to process where index value= n-1, that is, "zero-based" (ex: LINE1 index value=0, LINE20 index = 19). This list of LINEn attribute references can be zero to unlimited length. 1st = mapped to DWGDESC (the description under drawing "properties").
2nd = mapped to DWGSEC.
3rd = mapped to DWGSUB.
4th = mapped to FILENAME.
5th = mapped to FILENAMEEXT.
6th = mapped to FULLFILENAME.
7th = mapped to DWGNAM.
8th = mapped to SHEET.
9th = mapped to SHEETMAX.
10th = (not used for single drawing update)
11th = mapped to IEC_P (the drawing's IEC coding default for %P).
12th = mapped to IEC_I (the drawing's IEC coding default for %I).
13th = mapped to IEC_L (the drawing's IEC coding default for %L).
14th = mapped to 1st line only of DWGDESC
15th = mapped to 2nd line only of DWGDESC
16th = mapped to 3rd line only of DWGDESC

Description
Update title block attribute values.

Example 1
Update TB of active dwg, update attribs mapped to LINE1, LINE2, LINE3, and LINE37 as displayed in the UPDATE TB dialog box.

(c:wd_tb_process_one 0 (list (list 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0) 0 1 2 36))
Example 2
Update TB of active dwg, update attribs mapped to three lines of DWGDESC, SHEET, LINE2-3 and LINE12.

(c:wd_tb_process_one 0 (list (list 1 0 0 0 0 0 0 1 0 0 0 0 0 1 1 1) 1 2 11))
Example 3
Update TB of active dwg, update SHEET and SHEETMAX only.

(c:wd_tb_process_one 0 (list (list 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0)))


I hope this helps
Real Software Solutions
Rob Stein
Real Software Solutions
robert.stein@yourrealsoftwaresolutions.com
Active Member
mskanth
Posts: 8
Registered: ‎04-02-2009
Message 3 of 4 (240 Views)

Re: updating title block using vba

11-23-2009 04:49 PM in reply to: mskanth
Thank you so much.
This would give me a place to start with.
Thank you.
Contributor
RealSoftwareSolutions
Posts: 18
Registered: ‎10-29-2009
Message 4 of 4 (240 Views)

Re: updating title block using vba

11-24-2009 03:33 AM in reply to: mskanth
No problem, I hope it helps.

Thanks
Rob Stein
Real Software Solutions
www.yourrealsoftwaresolutions.com
Rob Stein
Real Software Solutions
robert.stein@yourrealsoftwaresolutions.com
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.