How to create a draft for a specific face

[ Edited ]




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.




'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


    If oFace.Area > oBiggestFace.Area Then

      Set oBiggestFace = oFace

    End If

  End If



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



Posted by: Pascal Boivin
Post date: 1/18/2010 2:30:41 AM