Some PanelingTools methods crash when called from Rhino.Inside

Hi there,

I’m using PanelingTools in my own Rhino plugin. I use it by adding the PanelingToolsDotNet.dll as a dependency (and making sure its C++ counterpart, PT_SDK.dll, gets copied to the same output folder).

I’d like to have unit tests (using Rhino.Inside to allow Rhino to run headless), however I’ve noticed there are 2 key PanelingTools methods that throw an exception invariably when called from within the context provided by Rhino.Inside:

1. PanelingTools.Utility.TrimGrid
2. PanelingTools.Utility.DivideSurfaceByChordLength

Here is a XUnit test run result that shows this:


Here is the source code for the test project:
PanelingToolsTests.zip (3.4 KB)

Make sure the configuration is on x64. I didn’t include the two PanelingTools DLL’s. But in order to run and build the test project, put both PanelingToolsDotNet.dll and PT_SDK.dll in the src folder, and the project should copy them to the output folder when built.

Any help would be much appreciated!

@rajaa - is this something you can help with?

I’m not sure since I haven’t used Rhino.Inside and not quite sure how dlls are called in that context. I can try to investigate next week.

1 Like

poke @rajaa I just wanted to check back on this

@kike Do you have thoughts about this?

@rajaa,

No idea, still haven’t play with Rhino.Inside on a testing framework.

May be it starts Rhino without and active document and paneling tools require one, for tolerances or other stuff, but looks like if you debug it you will hit quickly where the issue is.

Looks like some of the methods are correctly executed, but a couple aren’t. I will investigate.

1 Like

@Dustin_Condon
I just released a new PanelingTools version that you can download from the PackageManger. See if that works better for you.

Also, I put together few C# scripts for PanelingTools (inside GH C# component) to test few of the utility methods (including TrimGrid). They work as expected. Please find attached.

PanelingToolsSampleGHScripts.gh (33.6 KB)

One note about your plugin, please make sure that you set the CopyLocal to False:
image

1 Like

Awesome! That worked. Thank you very much!