Auto Center Lines for Patterned holes
Auto Center Lines for Patterned holes
(OP)
Hi,
I have a round part with 3 holes. These 3 holes are patterned (Pattern1). This Pattenr1 is patterned (Pattern2)
I now have this part with several holes due to above pattern.
On the drawing, I need these holes to be center marked (centerline) automatically.
I tried, but it wouldnt. Is there a way?
Thx
C1
I have a round part with 3 holes. These 3 holes are patterned (Pattern1). This Pattenr1 is patterned (Pattern2)
I now have this part with several holes due to above pattern.
On the drawing, I need these holes to be center marked (centerline) automatically.
I tried, but it wouldnt. Is there a way?
Thx
C1






RE: Auto Center Lines for Patterned holes
Hovewer, I have written a little macro which can help you. It automatically founds all circular edges on the selected face from Drawing View and inserts center marks.
So you should preselect the face where the holes are and run the following macro:
- - - - - - - - - - - - - - - - -
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swDraw As SldWorks.DrawingDoc
Dim swSelMgr As SldWorks.SelectionMgr
Dim swFace As SldWorks.Face2
Sub main()
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swDraw = swModel
Set swSelMgr = swModel.SelectionManager
Set swFace = swSelMgr.GetSelectedObject6(2, -1)
Dim vEdges As Variant
Dim swEdge As SldWorks.Edge
Dim swCurve As SldWorks.Curve
Dim swEnt As SldWorks.Entity
Dim i As Integer
vEdges = swFace.GetEdges
For i = 0 To UBound(vEdges)
Set swEdge = vEdges(i)
Set swCurve = swEdge.GetCurve()
If swCurve.IsCircle Then
Set swEnt = swEdge
swEnt.Select4 False, Nothing
swDraw.InsertCenterMark3 swCenterMarkStyle_e.swCenterMark_Single, True, True
End If
Next
End Sub
- - - - - - - - - - - - - - - - -
Hope this help.
Artem Taturevich
CSWP
RE: Auto Center Lines for Patterned holes