C# HiddenLineDrawing.Compute

Hello :wave:

I’ve been using the Make2D component in Grasshopper to create some automated assembly drawings, but looking to move it into a Rhino Plugin using HiddenLineDrawing.Compute.

I have a multiple components in an assembly, and when using Make2D in GH I collapse these components down into a single branch per assembly, i.e.

{0}[comp_A, comp_B, ... comp_X], {1}[comp_C, comp_D, ...]

I do this so Make2D can compute the occluded view/hidden line drawing as different components can overlap sometimes. Afterwards I use the original curve index to transform the list of curves back into their original component groupings and so I can re-link the component with their labels.

Question:
How do I create this association with HiddenLineDrawing.Compute? I can see the method returns a HiddenLineDrawing type where I can access the Segments class which has an parentCurve property - would the HiddenLineDrawingObjectCurve.SourceObject be the equivalent of the Visible Index output from the Make2D GH component? I’m finding the connections confusing to grasp…

Otherwise I’m pretty green at working with C# so if anyone has any suggestions/snippets for working with HiddenLineDrawing.Compute they would be welcomed :grin:

Much thanks,

L.

I think this answers my question. Leaving here for anyone else to reference:

Also found this in the developer samples - https://github.com/mcneel/rhino-developer-samples/blob/7/rhinocommon/cs/SampleCsCommands/SampleCsMake2D.cs