×
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 movements mates

Macro movements mates

Macro movements mates

(OP)
Since I got such a good response on a previous question even it being a  here comes  a new one.

In esence what I'm trying to do is a macro that will be able to move the non-fixed part of an assembly.

I checked the search forum:

http://www.eng-tips.com/viewthread.cfm?qid=82760

This looked like the closest thing I found. The current version that I am working on is SW 2006.

The trouble I have is saving in a macro the movements of a part. I've tried two ways:

1) Modifying a distance mate:
boolstatus = Part.Extension.SelectByID2("Distance8", "MATE", 0, 0, 0, False, 0, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("", "FACE", -0.02305839903214, 0.009669584224502, 0.01725, True, 1, Nothing, 0)
Part.EditMate2 5, 0, True, 0.0035, 0.0035, 0.0035, 1, 1, 0, 0.5235987755983, 0.5235987755983, longstatus

2) Manually moving the part
boolstatus = Part.Extension.SelectByID2("", "FACE", -0.02037484695022, 0.009043560237117, 0.01967773372371, False, 0, Nothing, 0)
Part.TranslateComponent

These both solutions, in my ignorance, seem quite Caveman type but are the only that I came up with.

I'm not expecting a straight answer but I've also checked the web pages of some users of this formum and seems that I am unable to execute most of the macros.

Is there some place where I can check what the SW objects do and how they do it. I preffer it free :)

RE: Macro movements mates

Start with SolidWorks API Help Topics from your Help menu.

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