algorithmic modeling for Rhino
Hi to all,
I'm writting a custom component for Grasshopper in C# with Visual Studio. I have as input:
protected override void RegisterInputParams(GH_Component.GH_InputParamManager pManager)
{
pManager.AddBrepParameter("BReps", "B", "Breps surfaces", GH_ParamAccess.list);
...
}
Now I select all Breps and export to a IGES file:
Rhino.RhinoApp.RunScript("_-SelAll " + " _Enter", true);
Rhino.RhinoApp.RunScript("_-export " + mIGESFileName + " _Enter", true);
But what I want is to select only the Breps passed as input not all what is present in the Rhino document. How can I achieve this?
Thanks
Robert
Tags:
Hi Tom,
Thanks for answering. Your solution greatly works for me. Thank you.
Rhino.RhinoApp.RunScript("_-SelAll " + " _Enter", true);
Rhino.RhinoApp.RunScript("_-export " + mIGESFileName + " _Enter", true);
That code specifically runs commands on the Rhino document. Those commands are not aware that Grasshopper exists, let alone that there's some breps in a parameter somewhere.
If you have to use the -_Export command, then your only choice is to:
As you can see that's pretty horrible. An alternative approach is to make a new 3dm file featuring only your breps and then somehow load that file and run the command on it.
I think Steve Baer has been working on (or at least thinking about) ways to run export and import apis on virtual 3dm documents, but you'll have to ask him about that on discourse.
HI David,
Thanks for answering. Your solution is a good alternative i will try for sure. Why do you think this solution can be better than that proposed by Tom based on GUIDS?
Thanks
Robert
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by