Worksession.ModelCount causes exception in RhinoCommon Mac


This is mostly a bug repport. We are developping an exporter plugin for Rhino6 on Windows and Mac using RhinoCommon and noticed that accessing the Worksession.ModelCount produces an exception on Mac:

System.EntryPointNotFoundException: CRhinoWorkSession_ModelCount assembly: type: member:(null)
at (wrapper managed-to-native) UnsafeNativeMethods.CRhinoWorkSession_ModelCount(uint,int&)
at Rhino.DocObjects.Worksession.get_ModelCount () [0x0000d] in <79631c0a3c24417a995c6588db8daa9a>:0

After a quick search it seems worksessions are not implemented on Mac, which I get, but then it’s strange that the RhinoDocument.Worksession variable is not null, but using it throws exception. In the end, it’s no big deal we can just try-catch this call or conditionnaly call it based on the OS, I just wanted to report the issue.


Hi @benoit.deschenes,

Thanks for reporting - I’ve logged the issue.

– Dale

RH-61157 is fixed in the latest BETA