Hi
I already know how to create a draft for a predefined orientation. But how do I create a draft to see a specific face? I would like the draft to be facing the biggest face of my object.
Thanks
'oSEApp is SolidEdge Application object
'oDoc is a PSM ou PAR object
Dim oFace As SolidEdgeGeometry.Face
Dim oBiggestFace As SolidEdgeGeometry.Face
Dim oDFT As SolidEdgeDraft.DraftDocument
Dim oDV As SolidEdgeDraft.DrawingView
Dim oML As SolidEdgeDraft.ModelLink
Dim oSheet As SolidEdgeDraft.Sheet
For Each oFace In oDoc.Models(1).Body.Faces(igQueryPlane)
If oBiggestFace Is Nothing Then
Set oBiggestFace = oFace
Else
If oFace.Area > oBiggestFace.Area Then
Set oBiggestFace = oFace
End If
End If
Next
IF Not (oBiggestFace Is Nothing) Then
Set oDFT = oSEApp.Documents.Add("SolidEdge.DraftDocument")
Set oML = oDFT.ModelLinks.Add(oDoc.FileName)
'*** Here, use the biggest face instead of the predefined orientation ***
Set oSheet = oDFT.Sheets.AddSheet("Front", igWorkingSection)
Set oDV = oSheet.DrawingViews.AddAssemblyView(oML, _
SolidEdgeDraft.ViewOrientationConstants.igFrontView, 1, 0.2, 0.2, _
SolidEdgeDraft.AssemblyDrawingViewTypeConstants.seAssemblyDesignedView, _
"Front", True, 1)
'Delete default view and keep only the new one
oDFT.Sheets.Item(1).Delete |