I try to get the parent of the "coordsys" feature, but failed.
Any other way to get the global position?
I shall direct you to this thread (Not trying to be rude): https://forum.solidworks.com/thread/90763#_ga=2.260597901.1003853611.1549946780-29c19e10-1dbd-11e9-95fd-ef62328bcb8d
thank you for the link.
And any other suggestion to the question above? thank you ~
I suggest trying something like this :
MathUtility swMathUtil = swApp.GetMathUtility
MathTransform swGBUcsTransform = swApp.ActiveDoc.Extension.GetCoordinateSystemTransformByName("MyUCSName")
Thank you Michael,
I tried this:
But it can only get the matrix transform of the coordsys in the root design tree. When the coordsys belong to a sub-assembly, the function return null.
And I also tried this:
CoordinateSystemFeatureData coord = (CoordinateSystemFeatureData)swFeat.GetDefinition();
MathTransform swTransform = coord.Transform;
The matrix transform return by this function is always successful, but the value is not global in the current assembly but local to the sub-assembly.
Then I tried to traverse the design tree from the coord to the root (the coord is selected by mouse clicking at first) and multiply all the transform of sub-assembly, but I even cannot get the parent of the coordsys feature...
Retrieving data ...