# Import CAD and automatically put them in a drafting view with dynamo

**URL:** <https://forum.dynamobim.com/t/import-cad-and-automatically-put-them-in-a-drafting-view-with-dynamo/22705>\
**Category:** Revit\
**Created:** [June 11, 2018, 6:27pm UTC](https://forum.dynamobim.com/t/import-cad-and-automatically-put-them-in-a-drafting-view-with-dynamo/22705 "2018-06-11T18:27:45Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![YRioux](https://avatars.discourse-cdn.com/v4/letter/y/c89c15/32.png) [@YRioux](https://forum.dynamobim.com/u/YRioux)\
**Post date:** [June 11, 2018, 6:27pm UTC](https://forum.dynamobim.com/t/import-cad-and-automatically-put-them-in-a-drafting-view-with-dynamo/22705/1 "2018-06-11T18:27:45Z")

</div>

Hi,  
is it possible to import CAD (dwg file) automatically with Dynamo in specifics drafting views of the project, but many files at a time?  
I explain myself,  
I have to import and convert 300+ CAD to Revit, but I don’t want, each time, to clic on import cad…  
Like 001.dwg import in drafting view 001, 002.dwg import in drafting view 002, …

Is it possible? And if so, how?

(is my question clear enough?)

---

<div class="post-metadata">

**Author:** ![awilliams](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/awilliams/32/114496_2.png) [@awilliams](https://forum.dynamobim.com/u/awilliams)\
**Post date:** [June 11, 2018, 7:08pm UTC](https://forum.dynamobim.com/t/import-cad-and-automatically-put-them-in-a-drafting-view-with-dynamo/22705/2 "2018-06-11T19:08:36Z")

</div>

Yes this is possible. Here is a previous thread on the topic that has a few versions of a Python script that will import a DWG file:

> [@Link DWGs in Drafting Views?](https://forum.dynamobim.com/t/link-dwgs-in-drafting-views/3127/26):
>
> Hi Rémy, One possible way is to change the output to provide Filepath. And with a string contain and a boolean mask you will obtain the ImportInstance. [Drafting View.dyn](https://forum.dynamobim.com/uploads/short-url/cIZ2KxXFh8gxNQbMptshIJkSw3N.dyn) (13.5 KB)

Set up a directory folder with all of your CAD files, get the directory contents, use DraftingView.ByName for each file and connect your files and the drafting views into the Python script

---

<div class="post-metadata">

**Author:** ![YRioux](https://avatars.discourse-cdn.com/v4/letter/y/c89c15/32.png) [@YRioux](https://forum.dynamobim.com/u/YRioux)\
**Post date:** [June 11, 2018, 8:43pm UTC](https://forum.dynamobim.com/t/import-cad-and-automatically-put-them-in-a-drafting-view-with-dynamo/22705/3 "2018-06-11T20:43:45Z")

</div>

Didn’t work, can you help?  
my two inputs are list, first the list of files dwg ans the second one, a list of drafting view.  
The python error is that it expect a string (str) but receive a list at line 41

thancks

 ![7](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/7/a7fbdea2aa8493bd16ab69cc67330a1198895710.PNG)

---

<div class="post-metadata">

**Author:** ![awilliams](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/awilliams/32/114496_2.png) [@awilliams](https://forum.dynamobim.com/u/awilliams)\
**Post date:** [June 11, 2018, 8:51pm UTC](https://forum.dynamobim.com/t/import-cad-and-automatically-put-them-in-a-drafting-view-with-dynamo/22705/4 "2018-06-11T20:51:43Z")

</div>

Could you show the preview on your Excel.ReadFromFile node? My guess would be your list structure. Try plugging your filepaths into a flatten node before the Python script

---

<div class="post-metadata">

**Author:** ![abel](https://avatars.discourse-cdn.com/v4/letter/a/2acd7d/32.png) [@abel](https://forum.dynamobim.com/u/abel)\
**Post date:** [May 10, 2019, 11:12am UTC](https://forum.dynamobim.com/t/import-cad-and-automatically-put-them-in-a-drafting-view-with-dynamo/22705/5 "2019-05-10T11:12:26Z")

</div>

Hi

I have tried this node with a list of file paths and views and it does not work for me.  
My goal is to read a directory and to catch all the dwgs from there…but how I can not get it to work for a list…That will be the second step…

I have tried with list.map.

I have tried list.map with transaction start and transaction end…

I have tried making this node a custom node.

I have tried with loop while, Clockwork passthroug and none of them I could get the node manage a list.

I tried modify the node with Python but I suppose I do not know how to do that properly and I could not get it to work.

Thank you in advance.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/d/7d4ab3bbb91c8c54c3e12bc8c6faa35b25343d08.png)

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [May 10, 2019, 12:33pm UTC](https://forum.dynamobim.com/t/import-cad-and-automatically-put-them-in-a-drafting-view-with-dynamo/22705/6 "2019-05-10T12:33:22Z")

</div>

Hi Abel,

Welcome to the Dynamo forum.  
Please read this topic which is similar to your request.

> [@Link/amend autocad layers in revit](https://forum.dynamobim.com/t/link-amend-autocad-layers-in-revit/35735/2):
>
> Hi @gazza23, You will find in the BimorphNodes and Genius Loci packages the appropriates nodes.

---

<div class="post-metadata">

**Author:** ![abel](https://avatars.discourse-cdn.com/v4/letter/a/2acd7d/32.png) [@abel](https://forum.dynamobim.com/u/abel)\
**Post date:** [May 10, 2019, 4:03pm UTC](https://forum.dynamobim.com/t/import-cad-and-automatically-put-them-in-a-drafting-view-with-dynamo/22705/7 "2019-05-10T16:03:34Z")

</div>

Thank you very much.

It worked.😃

I managed to get all dwgs in a directory and create drafting views with the names of the dwgs.

Moreover, I managed to position all list of dwgs in a unique drafting view and move them later.  
I used your help with the WombatDynamo unpin tool.

> [@Unlocking with Dynamo](https://forum.dynamobim.com/t/unlocking-with-dynamo/26929):
>
> Hello, Is there a way to unlock elements with a dynamo script? For example “Unlock all walls” or “Unlock walls from gridlines” Thank you

So, Thank you twice.

---

<div class="post-metadata">

**Author:** ![staylor](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/staylor/32/94307_2.png) [@staylor](https://forum.dynamobim.com/u/staylor)\
**Post date:** [October 28, 2019, 8:29pm UTC](https://forum.dynamobim.com/t/import-cad-and-automatically-put-them-in-a-drafting-view-with-dynamo/22705/8 "2019-10-28T20:29:40Z")

</div>

abel,  
I know this thread is old, but could you share your dyn file?  
Thanks
