Link Mulitiple DWGs + Create Drafting View for Each

I’m currently using a script that batch links multiple DWGs. Is there a way to link all of these DWGs and simultaneously create a Drafting View for each based on the file name? So, instead of coming into one view, the script creates one Drafting View per file?

Hi @ashley.hastings,

You can do this to create Drafting View and link a DWG to each of them :

Create Drafting View and link DWG.dyn (34.4 KB)

3 Likes

Thank you so much for this, @Alban_de_Chasteigner! Worked excellently. I have a tool that will fix the naming of the drafting views after the fact, but is there something in the script that would alter that instead? I get a lot of alphanumerics after the file name (which becomes the drafting view name).

You should show a screenshot of your graph with previews enabled under the nodes or try to change the values ​​of the String.Remove node.

So, I changed the node from Import (as you sent it) to Link DWG (as I need it) and it comes in with many extra characters after the name in the file. For example, in this screenshot, the end of the file you can see stops after the caps and ‘_’.

Importing or linking the DWG makes no difference.
Since you don’t want to display the entire graph and the preview of the FilePaths input, I can’t help you.

Hi Alban, sorry, but my goal isn’t to be unhelpful – I’m new to this and don’t know what you need in order to help. I thought only the problem part. Here’s the entire graph. And for what it’s worth, there was a difference between importing and linking – and the difference was the extra characters at the end of the drafting view names.


Well the Import or Link DWG nodes should not modify the names of the drafting views.
What happens if you create drafting views without linking DWG ? In this case, are there any extra characters at the end of the drafting view names ?

When imported, there are no extra characters – came in very cleanly. I only noticed the difference when I needed to refresh (what I thought were) links and saw they weren’t there, so had to restart. So when I changed the node to Link, I saw the difference in the name of the Drafting Views.