7 Replies Latest reply on Oct 12, 2017 4:56 AM by Kevin Pymm

    Making circles from points spliting surface

    Patryk Jamróz

      Hi all,

       

      For simulation reasons I need to split surface to many circles with the same diameter(to put force to this circle surfaces). I have sketch with points and I would like to make circles with the same diameter base on this points. Is any way to do it quickly? There is more than 1000 points so its hard to add circle in every point. Maybe do you have any macros? Or maybe there is any method to split surface base on points without doing circles?

       

      Maybe there is any other way to solve my problem - basicaly I need to perform simulation for a part where i need to put force in more than 1000 points. I have sketch with this locations (previously imported from the excel file).

        • Re: Making circles from points spliting surface
          Oliver Washington

          Sketch Driven Pattern if you have the points in a separate sketch

            • Re: Making circles from points spliting surface
              Iain McEwen

              I'd create the split line first, then make sure that all the other points are in a single other sketch, converting where necessary if they aren't already. You can then use the split line you've created as the seed and the sketch with the 1000 points in it to drive the pattern. You'll then be able to recognise all the separate faces for applying load in the sim; and you should even be able to select them all just by clicking the feature.

              • Re: Making circles from points spliting surface
                Patryk Jamróz

                Sketch Driven Pattern is good solution for that! Thanks.

                 

                In the meantime I made macro which imports circles into the sketch and than you just have to use this sketch in split line operation. See below:

                 

                Requiements: you have txt file with XY coordinates of points/circles. It doesnt matter if you have unit with cords or not. It works also without unit.

                Eg.

                 

                Steps:

                 

                1. Disable "enable snapping" option (because during import points will generate in wrong positions)

                2.Go into sketch mode selecting proper plane

                3.run the macro

                4. choose your txt file

                5. Done

                 

                info: in the macro below I make bold one parameter: 5 / 10000 - it's radius of your circle in metres. 5 / 10000 m = 0,5mm

                 

                ------MACRO CODE----

                 

                Dim swApp As Object
                Dim File As String
                Dim DialogTitle As String
                Dim InitialFileName As String
                Dim FileFilter As String
                Dim OpenOptions As Long
                Dim ConfigName As String
                Dim DisplayName As String


                Sub main()

                Set swApp = Application.SldWorks
                Set Part = swApp.ActiveDoc
                swApp.ActiveDoc.ActiveView.FrameState = 1
                Dim skPoint As Object

                File = swApp.GetOpenFileName("Select txt file", InitialFileName, "Text files (*.txt)|*.txt|", OpenOptions, ConfigName, DisplayName)
                If File <> "" Then
                Open File For Input As #1
                Do While Not EOF(1)
                Input #1, X, Y
                Set skPoint = Part.SketchManager.CreateCircleByRadius(X / 1000, Y / 1000, "0", 5 / 10000)
                Loop
                Close #1
                End If
                'Part.ShowNamedView2 "*Isometric", 7
                'Part.ViewZoomtofit2
                End Sub

              • Re: Making circles from points spliting surface
                Dan Pihlaja

                Are all these points that you are talking about on the same surface?   Or so they span multiple surfaces and planes?