What's new

Lock ALL / Unlock ALL configurations

WoodWorks

Alibre Super User
Lock ALL / Unlock ALL configurations

Any API gurus know if it would be possible to write a simple API program to LocK/UnLock ALL configurations at once?

I have posted and enhancement request concerning the need for this capability when modeling using a large number of configurations:

http://www.alibre.com/forum/viewtopic.php?t=2737

I am looking to create a callable stand alone program(s) to lock and unlock ALL configurations at once. I would like to incorporate this routine into my macros, and maybe even assign it to a keystroke shortcut.

I have had limited sucess in writing simple API programs, but am hindered by the lack of documentation, mainly the lack of information on the API and configurations. I may even be able to code this myself if I am pointed in the right direction.
 

WoodWorks

Alibre Super User


I have created a macro that will cycle through all the configurations and lock/unlock them all based on a manual input of the number of configurations.

I can improve this macro to accomplish the Lock/UnLock ALL automatically if I had a callable program that would return just the count of the total number of configurations.

Any suggestions on how to accomplish that within the API?
 

cclark440

Alibre Super User


It doesn't look like configurations are accessible in the current version of the API.
Have you specifically asked anyone at Alibre if they can be accessed?
 

cclark440

Alibre Super User


Well after a little research it still looks like the configs are not accessible. At least not the lock-unlock property of the configs. It seems that Alibre treats each config as a separate session. I have looked at all of the available properties and don't see anyway to distinguish which session is part of which part/assembly/drawing.

I will look at it a little further.

If you only have a sinlge part open you can return the number of sessions currently open. This will give you the number of configs in that part.
 

WoodWorks

Alibre Super User


I have not received a response from an email inquiry, and have not done any other requests for information due to the lack of official support for the API.

I have also been so busy creating models that I have not been able to just spend time experimenting with the API.
 

WoodWorks

Alibre Super User


Thank you for that info on sessions, that gives me a direction to start writing experimental code.

I can use that number of session information to provide the user a starting value as to the suggested number of configurations for my macro to process (with user confirmation).

I have improved my lock/unlock all macro to store the value last entered, and provide that as the default value for the next run. The macro then runs down the design explorer list and right clicks and presses either the Lock all or Unlock all button (based on users initial selection). It is a less tedious than right clicking on each configuration, and a lot faster than doing it manually.

The macro is captured keystrokes, with added logic looping, and some great intelligence in being able to select windows "controls" such as dialog options and buttons. But, my success with macros has also kept me from slogging through the API. I hope to use the API to provide added functionality to the macros via callable programs.
 

cclark440

Alibre Super User


If you would like I can send you the code for the simple application that I wrote to figure this out.

I used the free MS VisualBasic 2005 Express Edition to write it.

Let me know.
 

cclark440

Alibre Super User


Kirk

I was wrong about Each config being a Session.

The reason I thought that was becuase the part that I had been using as my sample when writting the little app had a boolean feature in it. So anytime a part/assembly/drawing references another part/assembly/drawing Alibre creates another session containing the referenced part(s).

On another note I have learned that Configurations are accessible in the new version of the API. The documentation just hasn't been updated yet.

I am looking into how the new interface works and I will let you know.
 

cclark440

Alibre Super User


Ok I found out how to access the Configurations.

Code:
        Dim adConfigs As AlibreX.IADConfigurations
        Dim adDesign As AlibreX.IADDesignSession
        
        adDesign = objRoot.Sessions.Item(1)

        iConfigsCount = adDesign.Configurations.Count

        'this adds the name of each configuration to a text box
        For Each adConfig As AlibreX.IADConfiguration In adDesign.Configurations
            RTB1.Text = RTB1.Text & adConfig.Name & vbCrLf
        Next

They have to be accessed through the DesignSession Object. Not the Session Object.
 

WoodWorks

Alibre Super User


Thank you Clint for all the hard work to provide these answers. I think I have enough information to work out my solution. I really appreciate the support given to a programming novice.

Kirk
 

Nick Lumb

Member
Alibre has moved on a long way since this topic started. Is there now a way to lock/unlock all configurations at once?

I was thinking I could just select all appropriate configurations and use the new keyboard shortcut to lock or unlock as appropriate - or even define my own shortcut. Unfortunately I cannot find the keyboard shortcut or even the ability to define my own.

Please can anyone point out what am I missing? Many thanks.
 

RCH_Projects

Alibre Super User
Nothing in the Menu tools or System keyboard assignment options.

I use the <ctrl> or <shift> select, with right click - Lock or Unlock; to choose configurations and Lock or Unlock all selected configurations at once.
 

RCH_Projects

Alibre Super User
I know, I know;
you have "right-click" the right spot or you lose your selection.

I am careful just to right-click the last configuration selected, without releasing the shift/ctrl (the ctrl doesn't matter, but doesn't hurt).

Glad you got it. 8)
 
Top