Is there any way to generate a geometry and keep it hidden to the point the operator can’t access it?
All geometry you generate using Rhino Common will only be accessible to the user once you send it to the document. Is that what you need?
Using RhinoCommon you can basically do everything that Rhino is capable of in your code. The geometry created is not inside the current Rhino document until you write it to the document.
Of course you would have to ensure that the operator also can’t access the source code of your script (Python/C#/VB.NET) if you really want to hide it, so to speak.
Hope this helps.
Are these entities created in RhinoCommom saved in the file? Or are they active only during code execution?
They exist only in memory during code execution (please correct me if this is the wrong way to phrase it, McNeel devs!).
They are only added to the document if you commit them into it, using one of the methods that inherit RhinoDoc.Objects.Add
, for more info on that method see here:
EDIT: Was on mobile yesterday, see here for all the different “Add-Methods” of the ObjectTable
:
https://developer.rhino3d.com/api/RhinoCommon/html/Methods_T_Rhino_DocObjects_Tables_ObjectTable.htm
I was looking for something like this to hack history. My goal is to have a parent frame and child frame that are in the doc’s object table and participate in history while invisible to the user. A ghost object (if it has a child).
Could you do that with DocObjects.Custom.CustomBrepObject? I can use a 1x1 planar surface to represent my frame. Then tell OnDraw and OnPick to do nothing (or render with a transparent mat) while it has history. If the history is gone, then draw and pick as normal.
The next problem is, how do you tell if something has children or not from RhinoCommon?