1 Reply Latest reply on Oct 1, 2014 9:39 AM by Jesse Seger

    How works DisplayWireFrameXOR in VBA or VB.Net?

    roberto gennari

      Hallo,

      I wanted to understand how it works DisplayWireFrameXOR Method (IBody2).

      I have a macro that make a Temporary Body, it works well with swBody.Display3 but does't works with DisplayWireFrameXOR.

      I thought I'd attach a macro so that someone can advise me

       

      This is my macro exsample:

       

      Sub main()

      Dim swApp As SldWorks.SldWorks
      Dim swModel As SldWorks.ModelDoc2
      Dim swModeler As SldWorks.Modeler
      Dim swBody As SldWorks.Body2
      Dim swPart As SldWorks.PartDoc

          Set swApp = Application.SldWorks
          Set swModel = swApp.ActiveDoc
          Set swModeler = swApp.GetModeler
          Set swPart = swApp.ActiveDoc
         
          Dim dblData(8) As Double
          dblData(0) = -0.0442
          dblData(1) = -0.322
          dblData(2) = -0.007
          dblData(3) = 1
          dblData(4) = 0
          dblData(5) = 0
          dblData(6) = 0.056
          dblData(7) = 0.033
          dblData(8) = 0.030368
         
          Set swBody = swModeler.CreateBodyFromBox(dblData)
         
          Dim bValue As Boolean
          Dim bIsTempBody As Boolean
       
          bIsTempBody = swBody.IsTemporaryBody
          '
          Debug.Print "Is the loft body a temporary body?  " & bIsTempBody
          '
          bValue = swBody.Display3(swModel, RGB(255, 255, 0), swTempBodySelectOptionNone)


      bValue = swBody.DisplayWireFrameXOR(swPart, RGB(255, 255, 0))     ' Here is the problem

      Stop

          swModel.ClearSelection2 True
          '
          Debug.Assert Not swBody Is Nothing

      End Sub

       

       

       

      Thanks to all