×
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

Macro

Macro

(OP)
I'm looking for some help in creating a macro that will start a sketch on a preselected face and offset a preselected loop and extrude the new sketch x number of units.  I've created a macro but macro becomes attached to that specific face on that specific part.  A little guidance should be adequate.  Thanks.

RE: Macro

What's your code look like so far?

Ken

RE: Macro

Make sure you clear the SelectionManager selections before you close the macro.

RE: Macro

(OP)
Okay I finally crippled together some code, which for now appears to work.

Dim swApp As Object
Dim Part As Object
Dim SelMgr As Object
Dim boolstatus As Boolean

Dim Feature As Object
Sub main()

Set swApp = Application.SldWorks

Set Part = swApp.ActiveDoc
Set SelMgr = Part.SelectionManager
Part.SketchManager.InsertSketch True
boolstatus = Part.SketchOffsetEntities2(0.00127, False, True)
Part.ClearSelection2 True
Part.ClearSelection2 True
Part.FeatureManager.FeatureExtrusion True, False, True, 0, 0, 0.00127, 0.00254, False, False, False, False, 0.01745329251994, 0.01745329251994, False, False, False, False, 1, 1, 1
Part.SelectionManager.EnableContourSelection = 0
End Sub

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