What's new

Saving: script is not really saved!!

R-man

Senior Member
I generate parts and assemblies completely via scripting. At critical points I save and run the script, and then correct based on the resulting part. For me the scripts are the main thing.

However, even though I save regularly, the actual python file on my computer is not actually updated until . . . I'm not sure when. But the upshot is that after Alibre crashes (as it does), and I re-open the python file, it is missing all the updates and fixes of several hours - even though I save regularily. Yesterday I spent the entire day recovering from a crash the day before. Today, I double checked some of that work, but most of the day was productive . . . until a few minutes ago. Another crash and I discover I'm back to where I was 6 hours ago. I typically have 3 or more files in play at a time: a general parameters file (my version of global parameters), a file to create a group of parts, and a file to assemble them in regular and exploded versions. All therse files get updated and modified as I work through the design and get the bugs out. They are all now back to 6 hours ago.

Saving a script must do something, the saved version must be somewhere. What can I do to be assured that save means SAVE! I'm very happy with the integrated editor and the abillity to immedialtely run a script. All ideas, suggestions welcome.

 

NateLiquidGravity

Alibre Super User
What are your Save/Load settings in Alibre Script's Options/Preferences. Here are mine below. That warning means I have to save them myself (in the script library) separately but that also prevents outdated duplicate scripts being saved inside the assemblies/parts. Scripts saved separately are not automatically opened - you have to do it yourself.

1635525956736.png

My guess is you have that first check box enabled and are seeing the outdated duplicate script being saved inside the assemblies/parts and not the one you saved separately.
 

R-man

Senior Member
Thanks Nate. I have a dummy part called 'script-window.AD_PRT' that I use for writing/running all my scripts. So my scripts aren't saved in the various parts I create - they are all saved in my 'script-window' part, and ideally, to the 'library' folder.

I think my problem was that I was saving scripts such that the the '*' was gone, but I was not saving the 'script-window.AD_PRT'. When I crash Alibre the versions in the folder are not up-to-date with my last 'saved' versions. When I save both the script and the part this problem doesn't seem to occur. (I haven't thoroughly tested this belief.)

My saving options had the top box checked, as you suspected. I now have the lower box checked. I'll see how that goes. By the way, it is possible to have both boxxes checked. What would be the result of doing that?

Again, thank you for your reply and suggestions! - Doug
 
Last edited:

NateLiquidGravity

Alibre Super User
I think you may understand it somewhat backwards yet. The one you save to the filesystem to get rid of the '*' was probably the most up to date but was not being loaded when you start Alibre Script. It only automatically loads the scripts saved inside the part.

As far as the two check boxes - they are for two different things. You can have either, both, or none checked.

The first one is what we have been discussing for enabling automatically saving a script inside the assembly/part (when the assembly/part is saved).

The second one is for allowing scripts to save their own data inside the assembly/parts (when the assembly/part is saved). Scripts accomplish this using the SetUserData and GetUserData methods. Most of the scripts available don't use this method but some do.
 

R-man

Senior Member
Nate,
Thanks for the clarification. That gives me a better way to think about how it all works. And now save means SAVE! :) - Doug
 
Top