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: 

updating title block using vba

3 REPLIES 3
Reply
Message 1 of 4
mskanth
646 Views, 3 Replies

updating title block using vba

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.
3 REPLIES 3
Message 2 of 4

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
Message 3 of 4
mskanth
in reply to: mskanth

Thank you so much.
This would give me a place to start with.
Thank you.
Message 4 of 4

No problem, I hope it helps.

Thanks
Rob Stein
Real Software Solutions
www.yourrealsoftwaresolutions.com
Rob Stein
Real Software Solutions
robert.stein@yourrealsoftwaresolutions.com

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

Post to forums  

Autodesk Design & Make Report

”Boost