×
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

What do you do after recording a macro?

What do you do after recording a macro?

What do you do after recording a macro?

(OP)
What do you do after recording a macro? I press play and nothing happens. Please help someone who wants to learn how to use vba.

RE: What do you do after recording a macro?

My only exposure to Macros has been assigning simple macros to tool bar buttons. It was important to save the macro in a folder in the same folder as Solidworks.exe. If you didn't then the Macro wouldn't run.

RE: What do you do after recording a macro?

(OP)
EUANS,
your right. Thank you.

RE: What do you do after recording a macro?

Unfortunately, the macro recorder is not always reliable. This is typically used as a basis for starting a macro or finding code for a specific action. You will need to learn more about the object library if you wish to do things that are not recordable. If you have any specific questions, please ask. There are plenty of members with a great deal of knowledge in this area.

DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.

RE: What do you do after recording a macro?

(OP)
dsi,
thanks for your generous offer, can you suggest a starting point for learning about the object library? SW help, Tutorials, books?

RE: What do you do after recording a macro?

As far as the macro, there are some things a macro does not record, like keystrokes.  Open the macro ("Tools --> Macro --> Edit") and see what was recorded.  Look up the commands in the API help.

As far as learning programming, pick up some books.  I bought VBA for Dummies and Visual Basic Weekend Crash Course from Barnes and Noble.  Those taught me the basics of object oriented programming and VB.

The trickiest part of programming in SW is learning what the different object types can do.  Many have values that are accessed by methods that one would think could be accessed by properties.

Good and evil: wrap them up and disguise it as people.

RE: What do you do after recording a macro?

TheTick is right on. If you are just starting VB, pick up the books he suggested. Once you are familiar with the concepts, you should be able to pick up the SolidWorks objects much easier. Some VARs actually offer API classes. I helped teach one that included the basics of VBA programming as well as the SolidWorks API. SolidWorks does have a training manual for their API, but I am not sure if you can get that directly from SolidWorks, or if it's only available through your VAR. It also includes a CD with plenty of samples.

DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.

RE: What do you do after recording a macro?

another thing to keep in mind is that the macro, as recorded, really isnt parametric, and does one specific task.

Since that task was already done when you first *recorded* the macro, re-running it may do nothing because the task has already been done.

RE: What do you do after recording a macro?

(OP)
Thank you people, I shall be buying the books. I look forward to giving you more interesting challenges in the future!

RE: What do you do after recording a macro?

CMcF,
     With help from dsi and others, I have saved our company $1000’s. Our title block is filled in automatically. The revisions are done through Visual Basic 6.0. Setting the revisions for our drawings, models and assemblies is a bit tricky, so Visual Basic helps set them. To get some quick ideas as to what can be done check out: http://www.nhcad.com/  and check out Joe Jones’ Macros/Examples.  Don’t give up, the hours you put in now will save many hours in the future. Start with something small and easy and go from there.

Bradley

RE: What do you do after recording a macro?

(OP)
Bradley
Thanks for the encouragement. I have some experience of automating CAD with ME10. I look forward to doing the same and more with SW. Thanks for the link.
Colin

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