3 Replies Latest reply on Feb 20, 2014 9:13 AM by Chris Johnson

    works in VBA but not .NET

    Chris Johnson

      Hi All,

       

      any guesses as to why this doesnt work  in .NET? but it does in VBA

       

      FYI this is inside of a property Manager Page if that somehoe matters

       

      for some reason it thinks my edge is not outer but im selecting the end face of a pipe...

       

      Sub LoadStartFace()

       

              Dim swModel As ModelDoc2 = iSwApp.ActiveDoc

              Dim swselMgr As SelectionMgr = swModel.SelectionManager

              Dim swLoop As Loop2

              Dim swSelFace As Face2

              Dim vLoops As Object

              Dim vedges As Object

              Dim EdgeEntity As Entity

              Dim i As Long

              Dim j As Integer

       

              'Refine Selection to OD Edge

              swSelFace = swselMgr.GetSelectedObject6(1, -1)

              If Not swSelFace Is Nothing Then 'Verify a Face is Selected before moving on.

                  vLoops = swSelFace.GetLoops

                  swModel.ClearSelection2(True)

                  For i = 0 To UBound(vLoops)

                      swLoop = vLoops(i)

                      If swLoop.IsOuter Then

                          vedges = swLoop.GetEdges

                          For j = 0 To UBound(vedges)

                              EdgeEntity = vedges(j)

                              EdgeEntity.Select4(True, Nothing)

                          Next

                      End If

                  Next

              Else

                  MsgBox("A Face Should be Selected at this point, program might be broken")

                  Exit Sub

              End If

       

          End Sub

       

      Thanks again!

       

      Chris