C# how to select objects to specify another file


#1

C# how to select objects to specify another file


(Dale Fugier) #2

Well, you can’t “select” objects from another 3DM file. But you can open another 3DM file, read its contents, and then add “it” to the current document using Rhino.FileIO.File3dm.

Does this help/


#3

First of all, thank you.
Methods the upstairs said I attempt was successful, but there is a big problem in writing new objects, each object must be converted, determine what type of object, and then use the corresponding method to add. It seems too much trouble.
Is there a direct export to the form of the direct export items selected as IGS or the Rhino supported formats.


(Dale Fugier) #4

To export to IGES or anything else, just script the Export command (e.g. “_-Export”) using Rhino.RhinoApp.RunScript.


#5

Try to use the script commands, but in the export will pop up when the save path selection dialog box.

Yes, I want to use C# to write a command to a file for each object selected are now. Is to save every object to a different file, to the name of the object to rename the file name, of course, object name is already predetermined quantities of export.


#6

Why the same commands can be executed in the script editor, the C# can not be executed. The following code is two
In the script editor:
Rhino.Command “-export c:\123.igs Delcam enter", True
In c#:
RhinoApp.RunScript ("
-Export c:\123.igs Delcam enter”, True);


#7

In the real export directory. Are there spaces?
If you use a path etc directly its better to use chr(34) to rhino knows its one directory

Example:
String FilePath = Chr(34) & c:\123.igs & Chr(34)
RhinoApp.RunScript ("_-Export " & FilePath & " Delcam enter", True);


#8

Thank you very much!
Now find out the problem, should be the style attribute is not defined in the ScriptRunner command type.
Lead has been unable to carry out.


#9

Did you add the CommandStyle(Scriptrunner) now? :slight_smile:


#10

Yes, it is.
Plus after successfully executed smoothly.