4 Replies Latest reply on Nov 8, 2013 7:45 AM by Mohammed Elkalakhi

    Strange behavior of hatched faces

    Mohammed Elkalakhi

      Hello everybody,

       

      I am developping an add-in on drawing documents,

       

      I want to check if a selected face is a hatched face so did this :

       

      1) I select a hatched face from the drawing section view

       

      sel2.png

       

      sel1.png

       

      2) I get the selected face that i want to check if it is a hatched face

       

              Dim mark As Integer

              Dim selObj As Object

       

              mark = sispmpsbSelFace.Mark

              selObj = swSelMgr.GetSelectedObject6(1, mark)

       

      2) I get all hatched faces from drawing section view

       

      There are 6 hached faces !!

       

      Dim hatches() As Object

       

      swView = swDraw.GetFirstView()

       

      While Not swView Is Nothing

       

           swViewType = swView.Type

       

           If swViewType = swDrawingViewTypes_e.swDrawingSectionView Then

       

                hatches = swView.GetFaceHatches() ' Here i get my hached faces

       

                ...


           End If

       

           swView = swView.GetNextView()

       

      End While

       

       

      3) I check if my selected face is in the liste of hatched faces,

       

      Dim hatch As FaceHatch

       

      ...

       

                          hatches = swView.GetFaceHatches() ' Here i get my hached faces

       

                          If Not hatches Is Nothing Then

       

                              For i = 0 To hatches.Length - 1

       

                                  hatch = hatches(i)

       

                                  If Not hatch Is Nothing Then

       

                                      hatchFace = hatch.Face


                                      If hatchFace Is selObj Then  I check if my selected face is the current hatched face

                                       

                                                   Return True

       

                                      End If

       

                                  End If

       

                              Next

       

                          End If

       

      But i dont find my selected face in the liste of hatched faces even if it realy existe but the comparison ( hatchFace Is selObj ) does not work.

       

      Can anybody help me,

       

      Thanks in advance,