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’.
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
Regards,
Scott Baugh, CSWP
www.scottjbaugh.com
FAQ731-376
RE: Animator Macro
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
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
Help?
Regards,
Christopher Zona - Senior CAD Designer
Litens Automotive Partnership
Concord, Ontario
RE: Animator Macro
"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
I'll scrounge around at home for it.
The pipe-bender vid was done with configs on Mike Wilson's site:
h
Flores
RE: Animator Macro
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.