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:
  • Like
Reactions: MDG

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: 29

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: 13

GIOV

Alibre Super User
Hello Nate,
Your script Isolate V4 is amazing. but in my big model require a lot of time to isolate a single part. I think the issue is the connection of the Design Explorer due that the isolate of the part in the Design Space Screen is instantaneous. You need only improve this issue. I still waiting 5 minutes.
If you avoid the connection with the Design Explorer and only need to run twice the script for isolate and back will be fine.
My version is AD21 and I do not have the Last script for run V5. The best for 2025!
1735582543369.png
 
Last edited:

NateLiquidGravity

Alibre Super User
I can't go back and test anymore on AD v21. You could try editing the Isolate V5 script to include the version build numbers you have or delete the entire version check. No guarantees that it will work.

As far as updating the Design Explorer that is an internal Alibre Design thing I have no control of. See if my previous suggestions help:
- try turning the Design Explorer off or at least "Collapse All" the tree first to drastically reduce the time it takes to update.
 

GIOV

Alibre Super User
I can't go back and test anymore on AD v21. You could try editing the Isolate V5 script to include the version build numbers you have or delete the entire version check. No guarantees that it will work
Thanks Nate,
Right now the script run AMAZING. fast with many parts. Now I need understand how reverse the isolate.
I am attaching the script Isolate V5 for ADV21
1.-Isolate v5 for AD21
Happy 2025!!!
1735614554877.png
 

Attachments

  • Isolate v5 for AD21.zip
    2.4 KB · Views: 2

GIOV

Alibre Super User
In this example of the classic Ford T:
1.-I Click the Part to Isolate:
1735615367896.png
2.-Run the Script V5 for AD21 and Done AMAZING
1735615481678.png
3.- For back I Hidden the Assemble and after unhidden the Assemble
1735615599646.png
4.-Unhidden the Assemble: DONE!
1735615686972.png
 

stepalibre

Alibre Super User
@GIOV, I didn't realize Alibre Python Shell works in V21. Your signature has V23. It was made with V27. The fact that AlibreX is the same today as it was in V21 is great backward capability. Unfortunately not so great if you want improvements and new features.
 

NateLiquidGravity

Alibre Super User
It is a bit concerning about the error messages shown in the console on some screenshots. I can't tell what it was as some of the error is cut off.
 
Top