RhinoDoc.ActiveDoc.Linetypes.FindName returns Continuous on fail

As said above, the documentation says it’ll return null. Which should be correct?


This code would return continuous. (Assuming you don’t have a linestyle called “ertqqweasdasd”.)

I need to know when the linetype isn’t found and only have the name. For now I can check the returned name against the one I tried to find.
I assume this method points at Find which means if it finds -1 it returns Continuous?

– cs

Hi @csykes,

Rhino’s hard-coded Continuous linetype has a hard-coded index of -1.

The following assumes you are not searching for a linetype named Continuous:

If you use LinetypeTable.Find and it returns an index of -1, then the function did not find your linetype.

If you use LinetypeTable.FindName and it returns the Continuous linetype, then the function did not find your linetype.

The comments for the value returned by LinetypeTable.FindName are vague. I’ll try to clarify them.



– Dale

1 Like