I’m trying to find the ngons in my Sub-D model. I can only find one, but the object description shows there are 3 5-gons.
Is there any command that I can use to find them more easily?
I found a way to narrow the ngons down to part of the mesh:
Can you work with Grasshopper?
This might be helpful. This is a c# script that you can load into the Rhino 8 ScriptEditor and run that will work like a command that marks each mesh or subd ngon center with a text dot displaying its NGon edge count and can optionally mark triangles and quads as well via a command line option.
MarkNgons.cs (2.0 KB)
How do you run this in a button? I know ! _-RunPythonScript "script.py", is there something similar for c#?
I’ve looked at this page but I can’t find a solution for c#:
Integrating macros and scripts into your workspace [McNeel Wiki]
Hi @martinsiegrist ,
Use the command -ScriptEditor in Rhino 8 to load and run this one. Then put it in a button like this with your unique path for the file… -ScriptEditor R M:\Scripts\MarkNgons.cs
Hi @BrianJ this currently fails. In Rhino 8 it says Compile Error in the command line. In Rhino 9 I get this error message:
Compile Error
Assuming assembly reference 'System.Drawing.Primitives, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' used by 'RhinoCommon' matches identity 'System.Drawing.Primitives, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' of 'System.Drawing.Primitives', you may need to supply runtime policy (Warning CS1701) file:///:[1:1]
Assuming assembly reference 'System.Drawing.Primitives, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' used by 'Rhino.UI' matches identity 'System.Drawing.Primitives, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' of 'System.Drawing.Primitives', you may need to supply runtime policy (Warning CS1701) file:///:[1:1]
@Trav wrote that one and may have an idea.
@Trav it seems that also python scripts in buttons fail to execute at the moment. That’s in Rhino 9… can someone please take a look?
hmm this sounds like something Ehsan @eirannejad is likely working on with the script editor for v9.
Thanks for the information. Hopefully it’ll woork again soon.
@martinsiegrist Try adding this
// #! csharp Trav
#r "System.Drawing.Primitives.dll"
or this to the top of the script
// #! csharp Trav
#r "nuget: System.Drawing.Primitives, 4.3.0"
Doesn’t seem to help in a button. Does it work on your end?
Nope. Actually neither does help from macro
Let me see what is wrong…
Ok good, neither helps here either. ![]()
Okay found the bug. Add these lines
#r "RhinoCodePlugin.rhp"
#r "System.Drawing.Primitives.dll"
I will put a fix for this for the next 8.x
This problem is in Rhino 9 WIP
And unfortunately I could not get a button to work yet…
8.x has the same problem so it will be fixed in both. What’s the error you are seeing now?
For reference:
RH-86357 ScriptEditor command required ref to RhinoCodePlugin
It still works in script editor but fails in a button.
Command: -ScriptEditor
Select Option ( Edit Run Open ): Run
Path of script to run ( Browse ): “C:\Users\martinsiegrist\AppData\Roaming\McNeel\Rhinoceros\8.0\scripts\MarkNgons.cs”
Compile Error
Assuming assembly reference ‘System.Drawing.Primitives, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ used by ‘RhinoCommon’ matches identity ‘System.Drawing.Primitives, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ of ‘System.Drawing.Primitives’, you may need to supply runtime policy (Warning CS1701) file:///:[1:1]
Assuming assembly reference ‘System.Drawing.Primitives, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ used by ‘Rhino.UI’ matches identity ‘System.Drawing.Primitives, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ of ‘System.Drawing.Primitives’, you may need to supply runtime policy (Warning CS1701) file:///:[1:1]