RhinoDoc.EndOpenDocument doesn't work starting with file in Rhino7

Hi,

I have a plugin with a panel that needs to be filled with data after reading the document. I added a handler to RhinoDoc.EndOpenDocument, but if the panel is already visibile at Rhino start-up and a file is passed as argument (via double-click on the file or “Open with” windows command) the event is never raised up.
This worked in Rhino6 but in every realease of Rhino7 it has never worked.
Is this a Rhino bug? Is there a workaround for this?

Thanks,
Marco

Hi @m.camillo,

Do you register your panel with the Rhino.UI.PanelType.PerDoc style? If so, then your panel should be recreated everytime a new document is opened, thus alleviating any need for RhinoDoc.EndOpenDocument event watcher.

Please review the following sample and let me know if you have any questions.

SamplePerDocPanel.zip (11.7 KB)

– Dale

Hi @dale,

thanks, that will need a quite big refactor but I’ll give it a try. Anyway, I tried to watch RhinoDoc.EndOpenDocumentInitialViewUpdate, which is actually fired, but as I build my panel content a Rhino.Runtime.NotLicensedException is fired. I created another topic about this (here) but maybe these are related in some way?

EDIT: I switched to a document based Panel, but the License exception is thrown during construction of the panel, the first time AreaMassProperties.Compute is called. Then if I hide and show back the panel everything works.

Thanks,
Marco