×
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

Animator Macro

Animator Macro

Animator Macro

(OP)
I'm finally learning how to use Animator.  My first avi attempt is rather hack, but time was of the essence.  This learning curve has led to thinking about a macro.

My hack attempt was to make a configuration for each sequence of movement and then use the screen capture because what I am capturing is a rather complex motion showing some torsional vibration characteristics of our product.  To get the screen capture, I have to click through each configuration, 144 in all, thus the need for a macro.

I tried to record one, but it isn't what I'm looking for.  The idea is to turn on screen capture and proceed through each configuration.  Since the screen changes when the configuration changes, it captures the new display of said configuration.  The macro that I recorded flips through the configurations In the background and only shows the last selected configuration.  So I only get two frames in my avi, start and finish.  Nothing in between.

Here's the recorded macro:

Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Dim FeatureData As Object
Dim Feature As Object
Dim Component As Object
Sub main()

Set swApp = Application.SldWorks

Set Part = swApp.ActiveDoc
swApp.ActiveDoc.ActiveView.FrameState = 1
boolstatus = Part.Extension.SelectByID2("001@Isolation Deflection.SLDASM", "CONFIGURATIONS", 0, 0, 0, False, 0, Nothing, 0)
Part.ShowConfiguration "001"
boolstatus = Part.Extension.SelectByID2("002@Isolation Deflection.SLDASM", "CONFIGURATIONS", 0, 0, 0, False, 0, Nothing, 0)
Part.ShowConfiguration "002"
boolstatus = Part.Extension.SelectByID2("003@Isolation Deflection.SLDASM", "CONFIGURATIONS", 0, 0, 0, False, 0, Nothing, 0)
Part.ShowConfiguration "003"

.. and so on to 144

I’m looking to sweep through each configuration, display the rebuild and capture the screen until the end.

I am able turn on the screen capture and then run a macro without it showing in the avi, so this doesn’t have to be a part of the macro.

Suggestions welcomed.  Written for me even better.  If ya’ ain’t cheatin’, ya’ ain’t tryin’.

Regards,

Christopher Zona - Senior CAD Designer
Litens Automotive Partnership
Concord, Ontario

RE: Animator Macro

Animator doens't support Configurations when making an animation.

Regards,

Scott Baugh, CSWP
www.scottjbaugh.com
FAQ731-376

RE: Animator Macro

(OP)
Not the animator itself, but from the Animator pulldown menu - Animator/Screen Capture/Turn On Screen Capture.

It starts up the avi record and then you can flow through your configuration manager.

Does that answer what you're looking for?

Regards,

Christopher Zona - Senior CAD Designer
Litens Automotive Partnership
Concord, Ontario

RE: Animator Macro

Animator does support configurations and what you are after is no problem.  The answer, as usual, can be found in the API help.  Take the "Iterate Through All Configurations Example (VB)" and paste into a new macro.  Start screen capture and then run the macro.  Stop screen capture when the macro finishes.  That's all you need.

FYI, this is the way to make animations of bending of sheet metal and tubing, which has been requested here many times.

RE: Animator Macro

(OP)
I'm sorry, I must be thick today.  I appear to be missing something.  The "Iterate.." does work, it seeems to be doing something in the background, but it's not rebuilding the video per configurations and therefore not making the avi.

Help?

Regards,

Christopher Zona - Senior CAD Designer
Litens Automotive Partnership
Concord, Ontario

RE: Animator Macro

That macro is for rebuilding the configs only:
"This example shows how to  iterate through all of the configurations in a document and forcibly rebuild each one. It assumed that you have an active document."

It sounds like what you need is a macro to run through each config and "save as .jpg".  I believe there was a macro for that on NHCAD, but the macro site is down.  Here is the Google "ghost" of it:
http://64.233.179.104/search?q=cache:GLTSZGOuwd8J:nhcad.com/old/html/example13.html+NHCAD&hl=en
I'll scrounge around at home for it.  
The pipe-bender vid was done with configs on Mike Wilson's site:
http://www.mikejwilson.com/solidworks/solidworks_files-05.htm

Flores

RE: Animator Macro

Yes the macro rebuilds all of the configs, which is exactly what was requested.

Animator does support configuration changes when recording the animation using screen capture.  Using a macro to iterate through the configurations will work, but the limitation is that you cannot use the PhotoWorks buffer (no rendered animations can be made using this approach).  I think I may have a workaround for this though but will have to try some experiments.

Here's what I do to make it work (SWX2005)
1)Assign the configuration iteration macro to a toolbutton.  You don't really have to trigger the macro from a button but it is easier if you do this regularly.
2) Set window size as required.
3) Zoom out so that the model will not extend past the boundaries of the viewport in any of the configurations
4) Choose "screen capture", type in .avi name and choose SWX screen renderer.
5) Run the config iteration macro from the toolbar button you assigned in step 1.
6) Stop screen capture.

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