Get Reference Planes of Coordinate System

Solution Partner Creator Solution Partner Creator
Solution Partner Creator

Hi

I have created Coordinate System by Matrix of Double.

 

SolidEdgePart.CoordinateSystem SE_Coordinate_System = SE_Coordinate_Systems.AddByMatrix(ref Coordinate_System_Matrix);

 

Then, i try to get Reference Planes of this Coordinate System, to use it in Substract operation.

 

when i call:

 SolidEdgePart.RefPlane Ref_Plane_1 = SE_Coordinate_System.get_Plane(SolidEdgePart.CoordinateSystemFeatureConstants.seCoordSysXYPlane);

 

I get E_FAIL error.

 

The Coordinate System created in Solid Edge, and I can see it and use it Reference Planes manually in Solid Edge (some internal code of Solid Edge can get the Reference Planes, but it fails by API).

 

Same error when trying to get Reference Planes of Base Coordinate System.

 

Solid Edge ST7 (no MP). Using C#

3 REPLIES

Re: Get Reference Planes of Coordinate System

Siemens Genius Siemens Genius
Siemens Genius

AddEx,

 

CoordinateSystem get_Plane returns a generic object type and not a RefPlane type, which may be why you are seeing the error. The returned object is akin to a planar 'face'. You can use, say objCSPlane directly or call objCSPlane.get_Geometry which will be a Plane from where you can get the geometry's parameters.

 

For example (VB.Net):
    Public Sub CSPlane()
        Dim objPartDocument As SolidEdge.Part.Interop.PartDocument
        objPartDocument = objApp.ActiveDocument

        Dim objCSPlane As Object
        Dim objCSPlaneGeom As SolidEdge.Geometry.Interop.Plane
        objCSPlane = objPartDocument.CoordinateSystems.Item(1).Plane(SolidEdge.Part.Interop.CoordinateSystemFeatureConstants.seCoordSysXYPlane)
        objCSPlaneGeom = objCSPlane.Geometry
        'objCSPlaneGeom.GetPlaneData(RootPoint:=pt, NormalVector:=norm)
    End Sub

---
Aditya Gurushankar
Manager, Solid Edge Planning

Re: Get Reference Planes of Coordinate System

Pioneer
Pioneer

I use the following: 

 

Face face =(Face)coordinateSystem.Plane[SolidEdgePart.CoordinateSystemFeatureConstants.seCoordSysXYPlane]; 
var refPlane = doc.AsmRefPlanes.AddParallelByDistance(face, 0, ReferenceElementConstants.igNormalSide, Type.Missing, Type.Missing, Type.Missing);

 

This however creates a new "visible" plane in the assembly, and I would rather like to have a more similar result as doing it by hand in the UI. 

Re: Get Reference Planes of Coordinate System

Experimenter
Experimenter

The option of Bazz will create a parallel reference plane which is visible in the tree of the UI.

 

When I create a sketch by hand in the assembly environment and use a ‘coincident plane’ of a coordinate system as plane, Solid Edge will create a reference plane automatically. This created ‘coincident reference plane‘ is not visible in the tree of the UI, only in the Spy.

 

Is there way to simulate this behavior using the API?

 

Is there a way to create a coincident reference plane that is completely invisible in the tree of the UI? Please note that the option ‘RefPlanes.AddCoincident‘ doesn’t seem to be present in the API.

 

Coincident system reference plane.PNG