3 Replies Latest reply on Apr 13, 2014 3:34 PM by Solidworks Selim

    axis of the macro delete

    Solidworks Selim

      axis of the macro delete

      delete centerline macro

      How to delete all at once

      file is attached.

      http://www.dosya.tc/server28/CbIkBh/DELETECENTERL_NEMACROS.rar.html

      Adsız.jpg

          • Re: axis of the macro delete
            Artem Taturevych

            Try this macro:

             

            Dim swApp As SldWorks.SldWorks

            Dim swDraw As SldWorks.DrawingDoc

            Dim swModel As SldWorks.ModelDoc2

             

            Sub main()

             

                Set swApp = Application.SldWorks

               

                Set swDraw = swApp.ActiveDoc

               

                Set swModel = swDraw

               

                swModel.ClearSelection2 True

               

                Dim swSheet As SldWorks.Sheet

               

                Set swSheet = swDraw.GetCurrentSheet

               

                Dim vViews As Variant

               

                vViews = swSheet.GetViews

               

                Dim i As Integer

               

                For i = 0 To UBound(vViews)

                   

                    Dim swView As SldWorks.View

                    Set swView = vViews(i)

                   

                    Dim vCenterLines As Variant

                    vCenterLines = swView.GetCenterLines

                   

                    If Not IsEmpty(vCenterLines) Then

                       

                        Dim swCenterLine As SldWorks.Centerline

                        Dim j As Integer

                       

                        For j = 0 To UBound(vCenterLines)

                            Set swCenterLine = vCenterLines(j)

                            Dim swAnn As SldWorks.Annotation

                            Set swAnn = swCenterLine.GetAnnotation

                            swAnn.Select3 True, Nothing

                        Next

                       

                    End If

                   

                Next

               

                swModel.Extension.DeleteSelection2 swDeleteSelectionOptions_e.swDelete_Absorbed

             

             

            End Sub

            ______________________________________________

            Regards, Artem Taturevych | Snr. Developer | IC3D ANZ

             

            IC3DSteel – New Steel Solution for SolidWorks

            translationXpert – SolidWorks files language translator

            LinkedIn - SolidWorks API Group