What's new

Configurations Player

Cator

Senior Member
Hi everyone,
for all those who use configurations to create many versions of the same part or assembly, I created this simple script that allows the timed and sequential opening of the configuration as in a sort of temporal presentation. It is useful for explaining the "history" of the piece or open assembly through images.
Regards,
Francesco
 

Attachments

  • Configurations Player.py
    256.8 KB · Views: 13

NateLiquidGravity

Alibre Super User
To automatically detect which environment you are in you can use some code which I stole from @idslk like this:
Python:
#Get Enviroment ---------- Thanks IDSLK
try:
    Enviroment = CurrentAssembly()
    EnviromentText = 'Assembly ' + str(Enviroment)
except:
    Enviroment = CurrentPart()
    EnviromentText = 'Part, Name: ' + str(Enviroment)

this lets you do things like:
Python:
if EnviromentText.startswith('Assembly'):
    print('This is an assembly')
or:
Python:
if EnviromentText.startswith('Part'):
    print('This is a Part')

And also things like
Python:
for j, configuration in enumerate (Enviroment.Configurations):
    time.sleep(T)
    P=Enviroment.GetConfiguration(Enviroment.Configurations[j].Name)
    P.Activate()
 

Cator

Senior Member
Thanks Nate!!
I want to try inserting it, it would certainly save some wasted shots.....
What if I wanted to make the window animated through those screens that I collaged into the window? Unfortunately the advice you gave me in PM is beyond my expertise.... do you think you can give me some application examples?
 

NateLiquidGravity

Alibre Super User
I'm afraid I didn't get that working. The image in that AlibreScript form does not update. Switching to a UtilityDialog was actually worse as it prevented the model from regenerating correctly.
You could write a custom winforms but that is a bunch of work.
I'd suggest saving the images to the computer, so the user can do something with them after. The script found in this post is a great example of that:
https://www.alibre.com/forum/index.php?threads/motion-script-needs-update-for-v27.24421/post-164392
 
Top