Is there a way to insert Title Block/Template into existing project and drawings (EPLAN>DWG) ?

Is there a way to insert Title Block/Template into existing project and drawings (EPLAN>DWG) ?

rchacinRUGAK
Contributor Contributor
1,797 Views
34 Replies
Message 1 of 35

Is there a way to insert Title Block/Template into existing project and drawings (EPLAN>DWG) ?

rchacinRUGAK
Contributor
Contributor

Hello, community, 

 

I'm working on a set of drawings imported from EPLAN. They lack any "intelligence" of course, including the fact the would've-been title block is just a block without any attributes, so changes need to be made manually on each page. Minor edits have slowly evolved into multiple pages, including the addition of new sheets, and the cumulative of having to manually edit minor details page by page (sheet count, drawn by, logo/image frame, page set up, etc.) is beginning to amount to something. 

 

I am wondering is there is a way to insert/replace this faux title block with the real one (i.e.: .dwt template) in the existing project, such that the contents of the (dozens of) pages stays the same, but  I have a real title block that can be globally updated more easily. Hopefully in a swift motion 🤞

 

Given the amount of pages, copying and pasting each drawing into a new project and and new sheet (using the right .dwt template with title block) would void the purpose.

0 Likes
Accepted solutions (1)
1,798 Views
34 Replies
Replies (34)
Message 2 of 35

rhesusminus
Mentor
Mentor

If you have access to the Eplan project, the easiest way would be to set up the DWG export properly.

You can export the plot frame as a block with attributes. 


Trond Hasse Lie
EPLAN Expert and ex-AutoCAD Electrical user.
Ctrl Alt El
Please select "Accept Solution" if this post answers your question. 'Likes' won't hurt either. 😉
Message 3 of 35

rchacinRUGAK
Contributor
Contributor

@rhesusminus thank you for your reply. Unfortunately, I do not have access to the original EPLAN file 😕

0 Likes
Message 4 of 35

arshdeepsingh404
Collaborator
Collaborator

Hi @rchacinRUGAK,

 

The action recorder can help you here. You can try recording your steps:

1. Carefully selecting the title block

2. Pressing delete key to remove the old title block (selection)

3. Use insert command to insert the new title block at 0,0

 

Since the old title block geometry should be at same location on all drawings, you can hit play on the recorded macro to auto execute the steps.

 

https://help.autodesk.com/view/OARX/2024/ENU/?guid=GUID-FEAD3614-CD33-4B60-BC00-4CBC98D8CBCB

 

The action recorder is a great tool for simple repetitive actions.

For anything more complicated, you will need to look into one the AutoCAD’s supported programming languages like AutoLISP

 

 

Arshdeep Singh
C.Tech, CMSE®

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 5 of 35

rchacinRUGAK
Contributor
Contributor

Thank you for your reply. Would that make the block "smart", so to speak? Meaning, will I be able to do a title block update  from the Project and Drawing Properties?

 

Additionally, my Title Block exists as a .dwt template (it's just how I learned to do it) which I can't insert. Do I need to create a block and save it as a .dwg file, in order to insert, I take it?

 

Thank you for your assistance. 

0 Likes
Message 6 of 35

rhesusminus
Mentor
Mentor

You can make it smart by adding it to the mapping field (wdt file), but it won't keep the values in the title block you already have. You'll have to extract those values some other way.

 

And yes. You have to open your det file and use the WBLOCK command to save your title block to an external block/file before replacing it. Use the "existing block" option in the wblock dialog.

 

 


Trond Hasse Lie
EPLAN Expert and ex-AutoCAD Electrical user.
Ctrl Alt El
Please select "Accept Solution" if this post answers your question. 'Likes' won't hurt either. 😉
Message 7 of 35

arshdeepsingh404
Collaborator
Collaborator

Hi @rchacinRUGAK 

 

Yes it will make the Title Block smart and you can set it up similarly how you do it for any regular AutoCAD Electrical Project Title Block mapping either using the .wdt method or WD_TB method.

 

Like @rhesusminus  already mentioned, You will have to open the create one new drawing with the .dwt template and run WBLOCK command to export the title block as a dwg.

 

arshdeepsingh404_0-1729221747508.png

 

Then you can bring in the exported dwg (title block) as a block to your existing drawings.

You will have manually populate the drawing level descriptions and sheet number again though as it will come as blank by default.

Arshdeep Singh
C.Tech, CMSE®

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 8 of 35

rchacinRUGAK
Contributor
Contributor

Hello, @arshdeepsingh404 @rhesusminus,

 

I just wanted to follow up on this thread as I stumbled upon a method to make this work through trial and error, and in the end your input "clicked" for me — so thank you. I think the disconnect was on the fact I did not know I could import the .dwg drawing as a block, and then use the .wdt file (Title Block Setup Method 1) to take care of mapping those attributes already in the drawing (same drawing I created to then use Method 2 WD_TB Attrib and created the .dwt file).

 

Using Arshdeep's suggestion of the Action Recorder certainly helps save a few clicks, but I am working on potentially hundreds of drawings per project, so I am exploring other methods to improve this process even more, and I'd appreciate your input:

 

  • In studying other ways to do this I found an option within Project>Other Tools>AESWAPWDMNOCHANGE. This unfortunately did not work, presumably because there isn't an actual title block in the drawing per se, just a block with no attributes in the shape of frame. 
  • This got me thinking and I tried command AESWAPBLOCK instead. This gives me the option to swap a block project-wide —so I thought, "Bingo!"— however, the "pseudo title block/frame" has a different name in each drawing, so it doesn't work (or so I infer). It works fine if I selected to swap a block drawing-wide. 
  • I tried to use the ACTRECORD command to maybe do this for me, but it hangs up on me when it comes time to go in the File Explorer and file the new block/.dwg. 

This got me thinking that if I could rename all of those blocks in one swift motion, then maybe I could use the AESWAPBLOCK command. The question being, how do I do that? I tried using the RENAME and -RENAME commands, but they only work within the drawing itself, and I need to know the name of the block ahead of time, which is very tricky because the were given random alphanumerical names with no clear way to distinguish them. 

 

So I guess my question to you would be: Do you know of any way I could A.) Either change the name of all of those (title//frame) blocks to a single name, or maybe B.) Execute the recorded action (Select and Delete old block->Insert new block [...]) for all drawings in the project at once, without having to go the next page and type the command every time?

 

I look forward to your comments. Thank you.

 

rchacinRUGAK_0-1738777214036.png

 

0 Likes
Message 9 of 35

rhesusminus
Mentor
Mentor

Or C.) change to Eplan.

 😂

 

Can you share a couple of drawings? You can remove all "secret" information and leave just the title.block.

 

 

 

 


Trond Hasse Lie
EPLAN Expert and ex-AutoCAD Electrical user.
Ctrl Alt El
Please select "Accept Solution" if this post answers your question. 'Likes' won't hurt either. 😉
Message 10 of 35

rchacinRUGAK
Contributor
Contributor

@rhesusminus I am with you 100%! I wish they had exported this differently or that I had access to the files and software myself, but I my hands are tied ☹️  — but I will try to get them to produce any new files the right way, whatever that means (would not mind if you had advice on that regard, too 😉😉)

 

When you say share a drawing, do you mean from the original set, or one containing the new [title] block I created?

0 Likes
Message 11 of 35

rhesusminus
Mentor
Mentor

I mean the original exported DWG files.

 

In Eplan, the title block is called a Plot Frame. This plot frame have several editable properties, one of them being "DXF Name". Here, you can specify what the block bane of the exported plot frames should be ine the DWG format. Then, in the DWG export, you can map the Eplan properties (like the page number and page description etc.) to a given attribute within this block.

 

 

 


Trond Hasse Lie
EPLAN Expert and ex-AutoCAD Electrical user.
Ctrl Alt El
Please select "Accept Solution" if this post answers your question. 'Likes' won't hurt either. 😉
Message 12 of 35

rchacinRUGAK
Contributor
Contributor

@rhesusminus  here are two examples. I had to strip them down, but they exemplify the issue I'm facing just as well. 

0 Likes
Message 13 of 35

rhesusminus
Mentor
Mentor

The good news, to me at least, is that these aren't Eplan drawings. They're created in a Danish software previously called "Caddy++", but now they go under the name "See Electrical" (Not to be confused with the French See Electrical Expert which is a completely different software package)

 

Looking at these drawings, it seems that ALL blocks are inserted at 0,0. So my plan to assume that the block inserted at 0,0 would be the title block, won't work.

 

A crossing selection between 420,0 and 400,20 gives you the correct block. After getting the block name, which as you said is random, you can use one of the c:wd_bswap* "API" commands in AutoCAD Electrical to switch to a different block. Extracting the text values from the block also would take some code, as they are text objects inside the block.

I wouldn't expect anyone to do this for free, so prepare to pay someone to create the code, or do it manually.

 

 


Trond Hasse Lie
EPLAN Expert and ex-AutoCAD Electrical user.
Ctrl Alt El
Please select "Accept Solution" if this post answers your question. 'Likes' won't hurt either. 😉
Message 14 of 35

arshdeepsingh404
Collaborator
Collaborator
Accepted solution

Hello @rchacinRUGAK 

I would like to try a different approach, Lets try running a script.

A script in AutoCAD is like a list of instructions that you give to AutoCAD to automate tasks, Its a little bit more advanced than the Action recorder.

https://help.autodesk.com/view/ACD/2024/ENU/?guid=GUID-BE44AE86-7638-48C9-BE5B-C1DF8E4C8808

 

ERASE
FENCE
0,0
20,20


_.-INSERT
"C:\Users\Virtual Machine\Desktop\Title Block.dwg"
0,0
1
1
0
ZOOM
EXTENTS
 

What I am trying to do with script is to delete the current title block by using the fence method and selecting between co-ordinates 0,0 to 20,20
Then I import the new title block at 0,0 and zoom extents on the drawing.

If this works well for one drawing, You can use the Project Wide utilities to run it across all drawings.
You can download the script from the attached folder. Remember to change the path of the template on line 8
Do not delete any blank line in the script as they simulate enter key.

 

Here is video of the script in action on the sample drawings you provided.

 

 

Arshdeep Singh
C.Tech, CMSE®

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 15 of 35

rchacinRUGAK
Contributor
Contributor

@arshdeepsingh404 that may have just worked! I have to inspect the rest of the files more carefully, but as far as the naked eye goes it's doing what it's supposed to. Thank you — that was outstanding!

 

If I'm understanding correctly, you're fencing between 0,0 and 20,20 to capture just a chunk of the old title block (and not other parts of the schematic), and then inserting the new title block into 0,0 (in my case that just matches the old block perfectly since it's the same template). What is the ZOOM and EXTENTS doing exactly?

 

Going on a bit of a tangent here but, I have now to detach the logo image (from the old TB; can't be found) a few hundred times via External References>"Image 1">Detach. How feasible would you say it would be to use a script for this as well? I would have to look into how/what to write, but I am wondering if it'll work to begin with — I'd love your input. 

Message 16 of 35

rchacinRUGAK
Contributor
Contributor

Thanks @rhesusminus. I would have never guessed it wasn't EPLAN. May I ask how did you deduce that, just for my own future reference?  This may help me tailor the message in the future to ensure files are exported properly from the get-go (if at all possible).

 

Arshdeep's scripted approach seems to do have done it elegantly. Fortunately, (or unfortunately, depending on how you look at it), the task at hand calls for me to have to input/edit or translate some drawing properties to make it into a ACADE cohesive project. Everything else I can push into the whole project through Descriptions and Title Block Update (via the Attributed like-for-like block replacement I'd made), so while it would be nice to have code to extract and populate this automatically, I guess it's less daunting than the original prospect.

 

Thank you!

0 Likes
Message 17 of 35

arshdeepsingh404
Collaborator
Collaborator

Hello @rchacinRUGAK 

 

I am happy to hear we are making progress in the right direction.

You are correct about the fencing, I am trying to grab a chunk of the title block to be on the safe side and then erase it.
Good to hear that the new title block fits perfectly over the old one.

 

Zoom Extents is just a method of zooming on the drawing so that all contents are visible. That was just a personal preference that I like to do before saving drawings so all the contents are visible, You don't have to do that if you don't need to.

 

Yes, you can detach Image XREFs using scripts!

 

A script is just a way to type out what you would normally do in AutoCAD's command line and save it for AutoCAD to run automatically.

For example: To detach an image reference, you can use a dialog-less version of commands. Most commands that show a dialog box can run without it by adding an underscore (_) and dash (-) in front of the command name.

 

For instance:

Typing IMAGE will open a XREF window.
Typing _-IMAGE will skip the XREF window and let you enter prompts directly in the command line.

 

To detach an image, you could write this in a script:

ERASE
FENCE
0,0
20,20


_.-INSERT
"C:\Users\Virtual Machine\Desktop\Title Block.dwg"
0,0
1
1
0
_.-IMAGE
_DETACH
"Title Block Logo"
 

Replace "Title Block Logo" name with the Image Name.
Now if we have different image names in every drawing, It will get more complicated and we will most likely have to take it another step above and write an AutoLISP program.

 

Let me know how you make out with this.

Cheers

Arshdeep Singh
C.Tech, CMSE®

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 18 of 35

arshdeepsingh404
Collaborator
Collaborator

Hello @rchacinRUGAK 

 

I see that you wanted to try to extract the attribute values as well and put them to the new block. This might be do able too if the names of the attributes are same across all drawings. Maybe ATTIN and ATTOUT can help us here.


Let's get part one of it working first where at least you can have a fresh clean set of drawing package with new title block for making additional progress on the actual project and we can keep playing around in the background with other methods to bring in the attribute values as well.

 

Arshdeep Singh
C.Tech, CMSE®

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 19 of 35

rhesusminus
Mentor
Mentor

The layer naming is a good hint:

rhesusminus_0-1738913158012.png

 

But, then you need to know what caddy is of course 😄

 

A typical DWG exported from Eplan with the default settings is attached. As you can see, there is no random naming happening here.

 


Trond Hasse Lie
EPLAN Expert and ex-AutoCAD Electrical user.
Ctrl Alt El
Please select "Accept Solution" if this post answers your question. 'Likes' won't hurt either. 😉
Message 20 of 35

rhesusminus
Mentor
Mentor

@arshdeepsingh404 

The problem is that there are no attributes. Only texts.


Trond Hasse Lie
EPLAN Expert and ex-AutoCAD Electrical user.
Ctrl Alt El
Please select "Accept Solution" if this post answers your question. 'Likes' won't hurt either. 😉