Reply

Find out axes

Good afternoon.
I'm starting to program in Solid Edge and would like to make an inquiry.
Sheet metal environment. I have a flat piece whose sketch is drawn on the  axis X:Z. Does exist the posibility to know from the code, the pair of axes in which it has been drawn the sketch?
I want to know that information to create a plane with the front view.
Thank you very much.

00.JPG

6 REPLIES

Re: Find out axes

If you know with feature contain the plane you need to discover you can use the Get method of this object:

 

Application.ActiveDocument.DesignEdgebarFeatures.Item("Cara 1").Profile.Plane

 

Re: Find out axes

Fiorini, good day.
Thank you very much for your reply.
I have:

 

Dim objApp As SolidEdgeFramework.Application = Nothing
Dim objDoc As SolidEdgePart.SheetMetalDocument = Nothing
Dim oDocs As SolidEdgeFramework.Documents

 

objApp = Marshal.GetActiveObject("SolidEdge.Application")
oDocs = objApp.Documents
objDoc = oDocs.Open(Path)

???=Application.ActiveDocument.DesignEdgebarFeatures.Item("Cara 1").Profile.Plane


That variable should save the result to interpret the axes?


Greetings.

Re: Find out axes


 


That variable is the plane where the sketch you mentioned is drawn.

 

Re: Find out axes

Fiorini,
Then I should have a flat type variable to store the reference:

 

Dim ObjPlane As SolidEdgePart.RefPlane
ObjPlane= objDoc.Application.ActiveDocument.DesignEdgebarFeatures.Item("Cara 1").Profile.Plane

Then use the properties for the axes?

 

AA.JPG


If so, what should I use?
I'm lost.
Thanks and I'm sorry for the inconvenience.
Greetings.

Re: Find out axes

[ Edited ]

What do you need the axes for ?
Sketches are made on planes not axes, and to create a plane you need a start plane not axes.

 

Anyway GetPlaneProperties returns also the plane axes.

 

There is an example in SDK

 

Syntax Visual Basic

Public Sub GetPlaneProperties( _
ByVal ReqRelAccy As Double, _
ByRef Area As Double, _
ByRef RootPoint() As Double, _
ByRef Moments() As Double, _
ByRef PrincipalAxes() As Double, _
ByRef RelAccyAchieved As Double _
)

Parameters
ReqRelAccy
Area
   Returns the area of the referenced plane.
RootPoint
   Returns the coordinates of a point on the referenced plane.
Moments
   Returns the Moment of Inertia about the three principal axes lxx, lyy, and lzz.
PrincipalAxes
   Returns the vectors of the major and minor principal axes.
RelAccyAchieved
   Returns the relative accuracy achieved in the properties computation.

 

Example:

Private Sub Form_Load()
Dim objApp As SolidEdgeFramework.Application
Dim objDoc As SolidEdgePart.PartDocument
Dim objModel As SolidEdgePart.Model
Dim ObjFace As solidedgegeometry.Face
Dim objPlane As Object
Dim dblRPoint() As Double
Dim dblReqRelAccy As Double
Dim dblArea As Double
Dim dblMoments() As Double
Dim dblPrincipalAxes() As Double
Dim dblRelAccyAchieved As Double
' Report errors
Const PI = 3.14159265358979
' Create/get the application with specific settings
On Error Resume Next
Set objApp = GetObject(, "SolidEdge.Application")
If Err Then
Err.Clear
Set objApp = CreateObject("SolidEdge.Application")
Set objDoc = objApp.Documents.Add("SolidEdge.PartDocument")
objApp.Visible = True
Else
Set objDoc = objApp.ActiveDocument
End If
'Create base feature
If CreateModel(objDoc) <> "" Then
MsgBox "Error creating the model"
Exit Sub
End If
'Get a handle to Model
Set objModel = objDoc.Models(1)
'Get the BottomCap of the Protrusion
Set ObjFace = objModel.ExtrudedProtrusions(1).BottomCap
'Get the Plane object
Set objPlane = ObjFace.Geometry
dblReqRelAccy = 0.0001
Call objPlane.GetPlaneProperties(ReqRelAccy:=dblReqRelAccy, Area:=dblArea, RootPoint:=dblRPoint(), _
Moments:=dblMoments, PrincipalAxes:=dblPrincipalAxes, RelAccyAchieved:=dblRelAccyAchieved)
' USER DISPLAY
' Release objects
Set objApp = Nothing
Set objDoc = Nothing
Set objModel = Nothing
Set ObjFace = Nothing
Set objPlane = Nothing
End Sub

 

Re: Find out axes

Maybe I explain incorrectly.
My program should open a new ".dft" to put an end view of a ".psm". You should always be front, for any piece:

BB.JPG


Because ".psm" can be drawn on X:Y, X:Z or Z:Y, I thought that if I got the pair of shafts where this sketch, it could indicate the correct orientation:

 

CCC.JPG
I do not want that looks like this:

 

DDD.JPG

Thank you very much.
Greetings.