How to access CRhinoOptionsDialogPage with C++?


I know how to create and add my own CRhinoOptionsDialogPage page, but not the way to access it from within any method in my code. There must be a public stack of the form ON_SimpleArray<CRhinoOptionsDialogPage*>& pages from which I retrieve it…

Thanks in advance,

Hi @NathanM1994,

There is no “public stack” of pages you can access. If you need access to your page some somewhere else, you’ll need to provide some kind of back pointer of your own.

– Dale

@dale one more question: how can I write and read custom parameters from my plug-in into a 3dm file? I know the way to do it through ON_UserData. But these parameters are not attached to a particular instance of geometry. They’re rather global, like a custom mesh parameter.


Hi @NathanM1994,

You can do so by writing custom document user data. You do this by overriding the following:

// Document user data overrides
BOOL CRhinoPlugIn::CallWriteDocument(const CRhinoFileWriteOptions&);
BOOL CRhinoPlugIn::WriteDocument(CRhinoDoc&, ON_BinaryArchive&, const CRhinoFileWriteOptions&);
BOOL CRhinoPlugIn::ReadDocument(CRhinoDoc&, ON_BinaryArchive&, const CRhinoFileReadOptions&);

You can find samples of this in the Rhino developer samples repo on GitHub.

– Dale

1 Like