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

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?)

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:

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

2 Likes

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

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

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.

Hi Abel,

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

1 Like

Thank you very much.

It worked.:smiley:

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.

So, Thank you twice.

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