Import DXF

Hi,

I want to create a command to import various dxf files into rhino.

For import I use this command:

Rhino.RhinoApp.RunScript("_Import " + path + " _Enter", false);

This function shows the file selection window, but, I know the path so I want to import it directly, without asking anything.

I’m working with RhinoCommon and c#

Thanks

Add a dash to the beginning of the command name will make it run “as a a script”.

Rhino.RhinoApp.RunScript("-Import " + path + " Enter", false);

There is some discussion of dashed commands in the Rhino help file.

1 Like

I have solved the problem writting the path in this way

string script = string.Format("_-Import “{0}” _Enter", path);
Rhino.RhinoApp.RunScript(script, false);

Thanks