I am trying to import .dxf file via grasshopper with c# component. Everytime I run the script dialog box is opened to select a path. What I am looking for is…
a) it shall take file path as an input and import it without opening dialog box.
b) I do not know if it is possible, but I want to have the imported .dxf inside grasshopper and not in rhino so only if it is necessary i ll bake it.
Any help is this regard would be great!
here is the code i used to import
Rhino.RhinoApp.RunScript("_Import", false); // and the it opens up the dialog box to select path
Or something along those lines, you’ll hae to try in the Rhino command line first what sequence of commands actually works. Don’t forget to surround your filepath by double-quotes lest the spaces in it terminate the command early.
Can you also suggest anything for this. I have many profiles of mullions(around 100.dxf files). I dont need .dxf file in rhino every time I import (I want to read the .dxf and display it in viewport using grasshopper).
what I did is, I referenced “.netDxf” library in c# and tried reading the file
however it does read the file but does not show the geometry in the viewport, not sure if this is the right way.
@stevebaer there was talk about exposing the file import/export plugins in the SDK by having them populate separate File3dm instances. Is that available in Rhino6? I couldn’t find anything in the api docs.
Sorry for that , let me rephrase.
For example, when I’m calling RhinoDoc.Export to export a dwg file, I can still see command line asking me for export options and the Export method is stuck until I type enter in the command line window.
It seems due to many plugins literally interprets FileWriteOptions.SuppressDialogBoxes as suppressing dialog boxes, so they ask options on the command line.
I can understand importer/exporter plugins will be updated eventually but it seems a big project.
This is exactly what I’m cleaning up when we find out about it. Initially we are just eliminating all coomand line and dialog input and choosing ‘default’ options. Over time we can add file format specific options/functions to RhinoCommon as needed.
Thank you for this script in latest wip, I succeed in collecting the dxf files I want, how to extract their respective layer structure, and filter the objects to be processed? I join sample dxf files:Limon1Gche.DXF (19.9 KB) Limon2Dte.DXF (22.1 KB) Limon2Gche.DXF (19.0 KB)