1 Reply Latest reply on Aug 17, 2016 3:47 PM by Keith Rice

    how to judge the edge is model line or silhouette edges  in drawing

    Bin Huang

      Hi All

       

            I write a code to dimension the arc in all views of drawings

       

      Now , I use the code    vEdges = swView.GetPolylines7(1, vPolyLinesBuffer) to get the edges and data

       

      How to know the edges is model line or silhouette edges?

      if  it is Silhouette edges ,how to select it by API

        • Re: how to judge the edge is model line or silhouette edges  in drawing
          Keith Rice

          Bin,

           

          Select a drawing view and run this code. All silhouette edges in that view will be selected.

           

          Dim swApp As SldWorks.SldWorks
          Dim swModel As SldWorks.ModelDoc2
          Dim swSelMgr As SldWorks.SelectionMgr
          Dim swView As SldWorks.View
          Dim swSilEdge As SldWorks.SilhouetteEdge
          Dim vEdges As Variant
          Dim i As Integer
          
          Sub main()
              Set swApp = Application.SldWorks
              Set swModel = swApp.ActiveDoc
              Set swSelMgr = swModel.SelectionManager
              Set swView = swSelMgr.GetSelectedObject6(1, -1)
              
              swModel.ClearSelection2 True
              
              vEdges = swView.GetPolylines7(1, Empty)
              
              If IsEmpty(vEdges) Then Exit Sub
              
              For i = 0 To UBound(vEdges)
                  If Not vEdges(i) Is Nothing Then
                      If TypeOf vEdges(i) Is SldWorks.SilhouetteEdge Then
                          Set swSilEdge = vEdges(i)
                          swSilEdge.Select2 True, Nothing
                      End If
                  End If
              Next i
          End Sub
          

           

          Keith

          SolidWorks API Automation Services