Hey
1. Everything you can do manually can be done by code, it just depends on the amount of work.
Can you share the file?
How do you want to select the "place" where should the holes be? Is there a rule (specified position) for that?
What is the origin of the spline, is it projected from the shape? If so, what part of it?
Which features will be present and which do you want to create by the code? (Workplanes, the spline, the lines, the circles' center points)
Where should the holes start?
Are the holes' planes perpendicular or parallel to something? The lines maybe?
Where do the lines come from and where do they lead?
2. Here's a sample for that:
Dim oDoc As Document = ThisApplication.ActiveDocument
Dim oCD As ComponentDefinition = oDoc.ComponentDefinition
Dim TG As TransientGeometry = ThisApplication.TransientGeometry
Dim oPlane As WorkPlane = oCD.WorkPlanes(1)
Dim oSketch As Sketch = oCD.Sketches.Add(oPlane)
oSketch.Edit
Dim CircleDia As Double = 11
Dim DiaReduce As Double = 2
Dim CircleCount As Integer = 5
Dim PointX As Double = 0
Dim PointY As Double = 0
For i = 0 To CircleCount
Dim CirclePoint As Point2D = TG.CreatePoint2d(PointX, PointY)
oSketch.SketchCircles.AddByCenterRadius(CirclePoint, CircleDia/2)
PointX = PointX + CircleDia
CircleDia = CircleDia - DiaReduce
Next
oSketch.ExitEdit
3. Can you translate the errors for us, so I can see what it wants? Anyway, it can be suppressed like this:
ThisApplication.SilentOperation = True
Try
'Do some operations
Catch
End Try
ThisApplication.SilentOperation = False
Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods