3 Replies Latest reply on May 20, 2016 10:10 AM by Kevin Chisholm

    Get sheetmetel bend direction in model

    Michael Caulton

      Hi, Is there a way to get the direction of sheetmetel bends relative to a surface from within the model similar to what happens in the drawings?

       

      Images below shows what I want to know but may not be the way it has to be done. Relative to the selected surface, are most of the folds up or down?

       

       

       

        • Re: Get sheetmetel bend direction in model
          Kevin Chisholm

          You can try this:

           

          '----------------------------------------------------------------------------

          ' Preconditions:

          ' 1. Open a sheet metal part with a bend feature.

          ' 2. Select the bend feature.

          '

          ' Postconditions: Inspect MsgBox

          ' ---------------------------------------------------------------------------

          Option Explicit

           

          Dim swApp As SldWorks.SldWorks

          Dim swModel As SldWorks.ModelDoc2

          Dim swFeat As SldWorks.Feature

          Dim swBendData As SldWorks.OneBendFeatureData

           

          Sub main()

              Set swApp = Application.SldWorks

              Set swModel = swApp.ActiveDoc

             

              Set swFeat = swModel.ISelectionManager.GetSelectedObject6(1, -1)

             

              Set swBendData = swFeat.GetDefinition

              If swBendData.BendDirection = 1 Then

                  MsgBox "Direction of the selected bend is UP.", vbInformation

              ElseIf swBendData.BendDirection = 2 Then

                  MsgBox "Direction of the selected bend is DOWN.", vbInformation

              Else

                  Debug.Print "Error getting the direction of the selected bend."

              End If

             

          End Sub

           

          You could probably traverse the design tree also to save the selecting process...

          Hope this helps!

           

          Kevin Chisholm

            • Re: Get sheetmetel bend direction in model
              Michael Caulton

              Hi Kevin, Thanks for the response.

               

              I do not think this is going to work for my application because one does not know what the up and down is in reliant too.

               

              With the part in its flat pattern state it can be brought to be normal to the screen (similar to how it would look in a drawing) and then from that orientation or relative to a selected surface I need to know the number of fold ups vs. fold downs.

               

                • Re: Get sheetmetel bend direction in model
                  Kevin Chisholm

                  Hi Michael,

                  I'll look into it soon. I know I can unfold the part, set the normal view

                  to the relative surface and look at each bend line to see if it's up or down.

                  Just wondering how to show the direction on the model, maybe with a note

                  attached to each bend line. Not as simple as the drawing view model.

                   

                  I'll get back to you, or if anyone has another idea, please share!

                   

                  Kevin Chisholm