What's new

Script Release: Fast Select for Assemblies

NateLiquidGravity

Alibre Super User
upload_2020-2-29_22-58-31.png

This script lets you select multiple objects in an assembly based on the settings you enter.

For example you can set it to select only Sheet Metal Parts with the word "Plate" in their Name AND that are currently Suppressed in the top assembly (as shown in the picture).

There are some oddities to be aware of:
"Hidden" only detects what is hidden when editing the top assembly level. "Search in Sub-Assemblies" will correctly find objects in Sub-Assemblies that are hidden at the top assembly level. Objects hidden when editing lower assemblies aren't necessarily hidden at the top assembly level.
"Made Flexible" can only apply to Assemblies.
You can select things in Sub-Assemblies but you can't preform all actions on them (for example parts in Sub-Assemblies can only be deleted when editing that Sub-Assembly)

If you have any issues or suggestions please post here about them. Also let me know if you use it and like it.
 

Attachments

  • Fast Select.py
    22.7 KB · Views: 61
Last edited:

NateLiquidGravity

Alibre Super User
I'm glad you find it useful.

As far as 'cost' analysis - I don't think that belongs in this tool as I don't want to combine them - but I'll think about adding an option in the other tool to show only selected.
 

cncgear

Member
Just a query, do both tools ignore configurations and list parts regardless of which configuration is selected?
 

NateLiquidGravity

Alibre Super User
I haven't extensively tested them with configurations but I know there is a bug with AlibreScript or the Alibre API reporting the configuration it was last active with not the current configuration used in the assemblies.
 

simonb65

Alibre Super User
I've noticed this occasionally but can't pinpoint a specific cause. I have a theory but inconsistent issues are hard to track down.
I think it's because you're creating and calling COM stuff from a separate thread and COM doesn't like that?! I presume you've done that to act as a worker thread in the background??

Edit: and doing a quick google may confirm that ...

"You need to instantiate the COM object within each thread you will be using it in." This is the simplest way, but not technically correct. You can access the COM object on another thread, but if your COM object is apartment threaded, the thread it was created on must still exist and be pumping messages. If the thread it was created on dies, the runtime must Release the COM object, and you will get this error message if you try to access the object on another thread
 

simonb65

Alibre Super User
I "get" that but I have yet to find anything that fixes it.
I suspect its the AlibreScript engine that needs to cleanly release and close the script down (or a callback to the script to enable cleaning up of threads, etc) when the parent application (Alibre) is closing, but before it closes. A question for Andy?
 
Top