I am looking for a macro button click to perform a Profile Mate. This would be a time saver as Profile Mate is so useful!
Attached is a macro with three sub-procedures:
I suggest that you create three macro shortcuts, one pointing to each sub procedure. Assign a keyboard shortcut to each. To use the macros:
1. Select the desired faces in the display area.
2. Hit the desired keyboard shortcut
3. If the alignment is wrong, hit Ctrl Z
4. Hit the other keyboard shortcut
5. If additional mate properties need to be changed, hit the EditMate keyboard shortcut. This should open the PMP for the last added mate.
I also included a warning message box in the event that the mate failed to add.
SolidWorks API Tutorials
Is there a way to have it open up the Profile Mate and stop before you hit the check-box? This would allow you to pick rotation and alignment. Otherwise this is what I was looking for!
You would have to create a custom user form that handles this. It would involve much more programming than what I have time to do for free. Alternatively, another sub-procedure could be written that opens the the "edit mate" PropertyManager page after you add a mate (should you desire to do so). If that's something you want me to write just let me know, shouldn't take too long.
Would you mind marking my answer as correct if it solved your problem? I would greatly appreciate it.
SolidWorks API Automation
I like the edit mate idea. If it's not too much trouble could you write it? Thank you for all that you have done so far. I have been using this Profile Mate all morning.
Do you know any examples or can you point me in the right direction on how to come up with the programming and user form?
I edited my original response to include the new macro with this third EditMate sub-procedure. Re-read the instructions above.
At the Videos page on my web site, there a video at the bottom called Taking Macros to the People that shows how to add a user form to a macro.
Both the aligned and anti aligned macros work great but I can't seem to get the Edit Mate to work. I get error message "Mate failed with error code 4" (or error code 5).
If you are getting an error it is when you are adding the mate, not editing the mate. Only the sub procedures that add the mates create a warning message when the mate fails to add.
Look at this to see what mate errors are occurring:
2014 SolidWorks API Help - swAddMateError_e Enumeration
Retrieving data ...