ds-blue-logo
Preview  |  SOLIDWORKS USER FORUM
Use your SOLIDWORKS ID or 3DEXPERIENCE ID to log in.
ESEric Snyder20/09/2021

I feel like I have all the building blocks but am missing something. I am trying to get the sketch segments and blocks (if any) contained in the block. I see I can get the sketch of the underlying block definition and get those sketch segments.

If I create a single block with a single line and test with that it seems that the values of the start and end points coming from the underlying sketch of the line they do not match up to where Solidworks says the start and end points are using the measure tool. They are quite a ways off. They are being transformed.

I see that ISketchBlockInstance has a property that returns a MathTransform object. It looks like these interact with ISketchPoint and ISketchVector.

I am guessing that the final sketch of a block is the ISketchBlockDefinition transformed to the final location behind the scenes using these transformation objects.

This leads me to the assumption that to get the final block instance sketch entities I need to transform the underlying block definition sketch to its final location???

This seems that the ability to transform points in 3D space would be so fundamental that I MUST be missing some kind of utility. Is there a Solidworks utility that I am missing that transforms the BlockDefinition sketch to the final location -or- do I need to transform the sketch myself using these objects somehow?

How should I get the sketch elements in their final locations when working on a block instance?