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: 

Subfolder title mapping to Title Block?

1 REPLY 1
SOLVED
Reply
Message 1 of 2
d2905
208 Views, 1 Reply

Subfolder title mapping to Title Block?

Hi All, 

 

Basically I'm looking for a way to map the immediate subfolder a drawing is placed under to a title block attribute automatically using the project descriptions, I've sifted through the fields and I couldn't seem to find anything. 

 

I found a post from 2015 sort of asking for the same thing so I am assuming I have looked in the wrong place or it doesn't exist. 

 

Regards

1 REPLY 1
Message 2 of 2
vladop
in reply to: d2905

Hi,

it is possible, but there are several problems that complicate the solution.

 

First call AESETUPTITLEBLOCK.

 

Here you have to choose the option that corresponds to the way title block settings are saved:

1) In a file "<Project>.wdt" located in the folder of the active project. The file name is the same as the project name with the extension "wdt". 

2) In a file "default.wdt" located in the folder of the active project.

3) In a file "default.wdt" located in the "...enu\support\user\" folder.

4) On the title block as an invisible WD_TB attribute

 

vladop_1-1678289798504.png

 

AutoCAD Electrical follows this sequence to determine which method to use:

it first looks for option 4) WD_TB attribute

then option 1) "<Project>.wdt" in the folder of the active project

then option 2) "default.wdt" in the folder of the active project

and finally option 3) "default.wdt" in the "...enu\support\user\" folder

 

Choose your option and click OK.

 

In the following dialog click "User defined" button in the lower right corner.

TB_EDIT1.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

In the next dialog:

1) in the Attributes drop-down list, select the attribute you want to use.

2) In the "Text constant or AutoLISP expression" text box copy this exppresion:

 

     (cdr (assoc (strcat (getvar "dwgprefix")(getvar "dwgname")) (vl-bb-ref 'subSect)))

 

Тhis expression also solves the problem of determining the active drawing during Title Block Update, since the function I would normally use always returns the drawing from which the Title Block Update was called.

 

3) Click "Update List" button

4) Click OK twice to exit dialog.

 

vladop_2-1678292242753.png

Here is a workaround.
Because the "Text constant or AutoLISP expression" text box accepts a limited number of characters, the following expression must be executed separately in the command line before calling Title Block Update:

 

(vl-bb-set 'subSect (mapcar '(lambda(x)(cons (nth 3 x) (last (c:wd_delim_str_to_lst (nth 8 x) "/")))) (nth 6 (c:wd_proj_wdp_data))))

 

It is possible to make this expression run automatically, but I wouldn't go into that.

 

Now call Title Block Update.

 

Regards,

Vladimir

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

Post to forums  

Technology Administrators


AutoCAD Beta