What's new

CTRL-Z ???

Zc@d

Member
Hello, what is the ctrl Z policy on Alibre?? Because it seems it works sometimes and other times not. It's really frustrating.
 
I think the behavior for redo and undo is they work only when the file is modified. When you save, that will clear the undo, redo stack. If the redo or undo arrow is yellow you can perform a ctrl y or ctrl z. If they are greyed out you cannot. So saving the file will commit all changes and start clean as if you closed and reopened the file.
 

Ex Machina

Senior Member
Also, I think that every time you roll back it also resets the Ctrl+Z behaviour. But I haven't experimented to verify
 

NateLiqGrav

Alibre Super User
It's dumb. It clears every time you switch modes.
Edit a part in assembly clears it.
Edit sketch in a part clears it.
Exiting the sketch clears it.
Returning to edit the assembly clears it.
So it is very limited in being helpful only while you stay in a mode.
But other things probably clear it too.
 
Last edited:

Zc@d

Member
It's dumb. It clears every time you switch modes. Edit a part in assembly clears it.
Edit sketch in a part clears it.
Exiting the sketch clears it.
Returning to edit the assembly clears it.
So it is very limited in being helpful only while you stay in a mode.
But other things probably clear it too.
Thank you for expliciting what clears it, was not clear for me! Indeed it's dumb. Extremely frustrating :rolleyes:
 
Based on how Alibre's API is designed I think this makes sense. Other software have a transaction like system where many operations write to the undo stack across domains. Alibre is heavily session/mode based.
 
The API has StartChanges() and StopChanges() it may be possible the create a longer undo stack in a custom script/tool.

C#:
class Program
{
    static void Main()
    {
        IADSession Session;
        IAutomationHook Hook;
        IADRoot Root;
        IADPartSession AdPart;

        Hook = (IAutomationHook)Marshal.GetActiveObject("AlibreX.AutomationHook");
        Root = (IADRoot)Hook.Root;
        Root = (IADRoot)Hook.Root;
        Session = Root.TopmostSession;
        AdPart = (IADPartSession)Session;
        AdPart.StartChanges();
        
        AdPart.StopChanges();
    }
}
 

NateLiqGrav

Alibre Super User
Based on how Alibre's API is designed I think this makes sense. Other software have a transaction like system where many operations write to the undo stack across domains. Alibre is heavily session/mode based.
As mentioned elsewhere Alibre Design began as a browser based multi user CAD. These things are probably due to that, and unnecessary unless Alibre re-introduces multi user ability.
 
As mentioned elsewhere Alibre Design began as a browser based multi user CAD. These things are probably due to that, and unnecessary unless Alibre re-introduces multi user ability.
Yes there aren't any methods for adding or removing entries on the undo/history stack like some software.
But it can be more efficient in general to have smaller undo caches or related data it adds up.
Perhaps undocumented - I don't see these in the API help, so I can't say what they are supposed to do.
1695182206724.png
Same here. I assume they're related to the undo stack or similar being inside the session labeled with words start/stop and changes. Undocumented so I won't try it no time soon but I made a note of it.
 

bolsover

Senior Member
@stepalibre , @NateLiqGrav

Python:
AdPart.StartChanges()
# do long process work here
AdPart.StopChanges()

I've always used these to improve performance of a script - to prevent redraws of a part between the calls.

Similar calls can be made at the Sketch level.

David
 

NateLiqGrav

Alibre Super User
@stepalibre , @NateLiqGrav

Python:
AdPart.StartChanges()
# do long process work here
AdPart.StopChanges()

I've always used these to improve performance of a script - to prevent redraws of a part between the calls.

Similar calls can be made at the Sketch level.

David
You know I thought it was familiar:

But it turns out the API help I'm looking my smart phone are outdated (v22) even though I just downloaded them here:
 
You know I thought it was familiar:

But it turns out the API help I'm looking my smart phone are outdated (v22) even though I just downloaded them here:
Wow V25 Beta API changes? :confused:

The method descriptions are missing in the documentation in the help file for V27.
I skipped theses and took a note of them for later work months ago.
From the source code here are the descriptions:

Code:
Signal to session that you are about to make model changes. This will allow the session to wait until all changes are completed before sending model change events.
void StartChanges()

Signal to session that you have finished changing the model so that it can now send consolidated set of model change events.
void StopChanges()


Thanks Super Users :).
 
Top