Import multiple dxf files

Hello Forum,

I am currently working on a gis project, the client provided me with over 1000 single dxf files (buildings) which I would like to import into a landscape mesh. Since I would really like to avoid to do this manually, I would like to ask if someone knows a way to automate this .

thanks and best regards

Andreas

Attached is my current batch import script, which takes a variety of formats including dxf. Each file is imported into a layer which corresponds to the file name. It imports all files of the chosen type found in a single folder (does not do subfolders).

However, if you are not looking to have separate layers for the files (1000 layers is difficult to manage), then you don’t need the script - just browse to the folder where the dxf’s are located, select all (or just the files you want), drag and drop the whole thing into an open Rhino window (blank file) and choose “Import” from the dialog box that comes up. Then let all your files import - all objects will go to the current layer.

HTH,
–Mitch

BatchImportGen.rvb(2.8 KB)

9 Likes

Thanks Mitch, you helped me alot!

I have not thought about the drag and drop possibility, stupid me…

best regards

Andreas

HI Mitch ,

I was looking for a solution to allow me importing “n” step files directly in Grasshopper

your script does exactly what i need ( i.e. importing the N files and placing in different layers" but it does it in rhyno . I would like to start this process not from Rhino but directly form GH thus to allow me porcessing the geometries and all informations contained in the their names.

I am quite familiar with GH now but no yet experienced in VB script, i know that there is a VB script component in GH but i have no clue on how to use your script inside of it.

If you know how to launch the script from GH in order to get filenames and geometries in GH ( + in rhino separated in different layers ) and if you are willing to help me I’d really really appreciate

many thnaks in advance

Ivan - Veneto - IT

Great tool. Should be a standard function to import multiple objects to file named layers.

Thank you,
Micha

Just wanted to say thanks - I was having issues batch importing STEP files. For some reason pasting in multiple lines copied from text file (with -_import command & each file name) only brought in the first one - even shutting off import option warning screen.

Your script did the trick. THANKS!!!

hi Mitch@Helvetosaur, thanks for this script!

Supper handy today that I had to figure out which Loc-line components to buy for a prototype. Their website has this level of access to their CAD parts, so I was able to import it all in one shot:

Then turn off all the ones I knew wouldn’t be useful, and spread out with numeric gumball all the possible ones to work out for this job.

Best,

Gustavo

is there a way to make each import a group

Great script, saved me a lot of time. Thank you Mitch

Arthur

Sorry to revive an old thread but am looking to use this script as a time saver, looks excellent. However I get an error

image

Any ideas how to fix? I am not familiar with scripts.

Thanks

That’s a pretty old script… How are you trying to run it?

Hi Helvetosaur

Just revisited this thread, the script works fine when dragging and dropping it into Rhino just not when using ‘load script’

Thanks

1 Like

Hello - LoadScript seems to do fine with this script here…

-Pascal