×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Auto Center Lines for Patterned holes

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

RE: Auto Center Lines for Patterned holes

It is a strange behavior. I don't see any other way then putting center marks manually.

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

(OP)
Thanks a lot. Please accept a star from myside :)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources