15 Replies Latest reply on Mar 20, 2013 2:04 PM by JD Sareault

    Select all the edges on a face

    JD Sareault

      Is there an easy way to select all or most of the edges on a face at once? I'm trying to apply a draft to a part with hundreds of holes of a specific shape that needs to be maintained, so I'd like to preselect the edges and then apply a parting line draft. Is there an easy way to do this?

        • Re: Select all the edges on a face
          Bjorn Hulman

          right click on the edge and use select loop. You can change the loop  by clicking the yellow arrow.

          • Re: Select all the edges on a face
            Lenny Bucholz

            you can also use the selection filter set to edges only and rubberband around the part and it will pick the edges only.

             

            filter 1.jpgfilter 2.jpgfilter 3.jpg

             

            Message was edited by: Lenny Bucholz

            • Re: Select all the edges on a face
              Jacob Corder

              When all else fails, create a macro. Get the selected face, and then you will have to loop in the code to select all edges. Quite simple actually. If interested I could help you with the code

                • Re: Select all the edges on a face
                  JD Sareault

                  That might be my best bet. Where do I get started coding this? I've done a little programming before but I've never used macros in Solidworks

                    • Re: Select all the edges on a face
                      Jacob Corder

                      Dim swApp As Object

                       

                       

                      Dim ModDoc As ModelDoc2

                      Dim boolstatus As Boolean

                      Dim longstatus As Long, longwarnings As Long

                       

                       

                      Sub main()

                      Set swApp = Application.SldWorks

                      Set ModDoc = swApp.ActiveDoc

                      Dim SelMgr As SelectionMgr

                      Dim EdgeCount As Integer

                      Dim Edges() As Edge

                      Dim SelFace  As Face2

                      Dim SelData As SelectData

                      Dim SelectedCount As Integer

                       

                      If ModDoc Is Nothing Then

                      Else

                           Set SelMgr = ModDoc.SelectionManager

                           If SelMgr.GetSelectedObjectCount2(-1) = 1 Then

                                Select Case SelMgr.GetSelectedObjectType3(1, -1)

                                          Case swSelectType_e.swSelFACES

                                               Set SelFace = SelMgr.GetSelectedObject6(1, -1)

                                               If SelFace Is Nothing Then

                                               Else

                                                    EdgeCount = SelFace.GetEdgeCount

                                                    Edges = SelFace.GetEdges

                                                    Set SelData = SelMgr.CreateSelectData

                                     ''If you only want edges and not the original face then uncomment this out

                                                    ModDoc.ClearSelection2 (True) ' This Clears the selected Face

                                                    SelectedCount = SelMgr.AddSelectionListObjects(Edges, SelData)

                                                    swApp.SendMsgToUser2 "There Were " & SelectedCount & " Edges Selected", _

                                                swMessageBoxIcon_e.swMbInformation, swMessageBoxBtn_e.swMbOk

                                    

                                               End If

                                End Select

                      End If

                       

                       

                      End If

                       

                       

                      End Sub

                      • Re: Select all the edges on a face
                        Jacob Corder

                        Also we can filter the types of edges using curve objects. just create a new macro, and paste this in. if you dont want the face still selected then leave it as is, if you want the face still selected comment out  or use a ' in front of the ModDoc.ClearSelection2.

                         

                        If you need this to go into a feature type form we can do that to. i just need to know that form. i think you said draft. or select the face, run this macro, then hit the feature.

                        have you used macro buttons?

                        if not right click the command mananger, select customize, select the commands tab, select macro under categories, then the icon to the farthest right is a macro button that you can drag into any command mananger tab and link it to a macro.