Lesson 2.1 – Recording And Editing Your First Macro

You need to be logged in to view this content. Please login or become a member.

<<  Prev   |   Index   |   Next  >>

Description

This lesson covers the macro recorder built into SolidWorks, including its uses and limitations.

Notes

There are no additional notes for this lesson. If you think I missed something, didn’t explain something clearly, or made a mistake, please leave a comment at the bottom.

Lesson Files

There are no lesson files for this lesson.

Homework

There is no homework for this lesson.

 

3 Comments

  1. Avi

    The video is so great! Thanks for your very nice video.I’ve learnt a lot through it.

  2. sina2sina

    Hi Keith,

    I have a problem with this simple task:

    I draw a box, select an edge, press record, apply a fillet on it, press stop and save the macro.
    next, I undo the fillet, click on another edge and run my macro, solidworks applies fillet on initial edge, not the one I select now.

    What should I do about it?

    Next,

    1) I open a X_T file,
    2) then select a face, press record button,
    4) translate (in a way to increase volume) a face from “direct editing” tab,
    5) press stop button and save the macro,
    6) undo my translation, select a face, and play the macro.

    It doesn’t work again!
    it applies the translation on random faces,
    In fact my question is, how can I “select” faces (plane, non-plane) and edges (which none have names/attributes) on drawing (part), then I can apply my function, like translation, or fillet.

    Thank you,
    Sina

    • Concerning your first problem — the macro recorder has recorded you selecting a specific edge, so when you run the macro, it will always select that edge. You will need to use ISelectionMgr to get the edge you have pre-selected and then use that for the fillet. You might consider posting this question in the SolidWorks API forums, and perhaps someone can help you write this. Right now I am unable to write macros for free, unfortunately.

      Concerning your second problem — the direct editing functions are probably not supported by the macro recorder. There are many things that the macro recorder cannot record. You will need to use IFeatureManager::InsertMoveFace3 in order to move a face with the API.

      The macro recorder is not very useful, as you can tell. To use the SolidWorks API, it is necessary to learn basic programming, which is what my video course focuses on teaching.

Questions and Comments

You must be logged in to post a comment.