Sunday, February 05, 2012
How to create a draft for a specific face
Last Post 18 Jan 2010 08:30 AM by Pascal Boivin. 0 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Pascal BoivinUser is Offline
New Member
New Member
Posts:13

--
18 Jan 2010 08:30 AM  

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

You are not authorized to post a reply.

Active Forums 4.2
Copyright © 2011 JasonNewell.NET