What's new

Script Release: Isolate v5

NateLiquidGravity

Alibre Super User
Isolate V5 Released:
https://www.alibre.com/forum/index.php?threads/script-release-isolate-v4.21245/post-167288

Original Post for Reference:
This script lets you Isolate selected objects in an assembly.

To Isolate:
Select objects, run the script.
All other objects are hidden. Any that were already hidden are recorded.

To End Isolate:
Run the script again.

Note:
Use at your own risk. This script uses undocumented features of AlibreScript. Be extremely careful with modifications.

Isolate v3.py had 12 downloads. Please use the newest version linked at the top of this post.
 
Last edited:

idslk

Alibre Super User
Hello Nate,

If i run isolateV3 the second time in a part and the isolated part is still selected, i have to unhide the hidden parts manually...
I've not tried to find the reason, but i think the second state with the hidden parts overrides the initial state so the "third" start can't "recover" the the state from the first start...I don't know if this was intended.

Regards
Stefan
 

NateLiquidGravity

Alibre Super User
I assume you are running in the Assembly not "in a part".

It should first check if the list exists in UserData.
If there is a list then it uses it to end isolate and exits.
(When it ends isolation it should restore the original hidden/shown state for all)
If there is no list then it checks for selected items.
If none are selected then it prompts the user to select some.
If there are some selected then it isolates them.

Do you have "save user data" checked in AlibreScript settings?
 

idslk

Alibre Super User
I assume you are running in the Assembly not "in a part".
Sorry, of course...
Do you have "save user data" checked in AlibreScript settings?
upload_2019-9-29_11-12-54.png

If the script is executed the first time it hides all not selected parts and prints to the console: Isolate

If the script is executed the second time with something or nothing selected (to get the parts unhidden) does nothing except printing to console : Nothing Selected to Isolate.

Rarely (haven't found when...) it states "End Isolate" but nothing else happens...

Regards
Stefan
 

NateLiquidGravity

Alibre Super User
I figured it out. If there was nothing originally hidden by the user prior to running the script then it was not saving any UserData.
Isolate V4 fixes this.
 

Attachments

  • Isolate v4.py
    5.2 KB · Views: 27

NateLiquidGravity

Alibre Super User
Thanks for testing. I'm happy when people tell me if it is or is not working. - I may otherwise never know. I was always testing in an assembly with things already hidden.
 

NateLiquidGravity

Alibre Super User
Isolate V5 Released:
V5 speeds things up. Added print of times. Only tested on Alibre Design V27 and therefore limited to Alibre Design V27.

Details: I found wrapping the Isolate and End Isolate functions in PauseUpdating / ResumeUpdating() has made the functions nearly instantaneous even on large assemblies. I tested on an assembly containing an array of over 10,000 parts and it took less than a minute* to Isolate and End Isolate a bunch of parts.

* Creating the array of that many parts took minutes to build - so I suggest you don't try that - but the Isolate and End Isolate was fast. However I discovered that for huge assemblies the function will be done fast but the Design Explorer and other things can take a long time to update after - try turning the Design Explorer off or at least "Collapse All" the tree first to drastically reduce the time it takes to update.
 

Attachments

  • Isolate v5.py
    9.9 KB · Views: 6
Top