26 May, 2019

Deploying Automation

CATIA provides two methods to deploy automation written in EKL to end users; enabling organizations to streamline tools for maximum impact. Let's take this EKl action as an example:

Assign Color Based On Attribute Example

I previously posted on how to assign different colors to physical products. Today I'll show a variant of that post.

The code below will look up all ProductOccurrences in an Editor, and assign a color to those whose V_description attribute is empty or filled, set by a boolean.


//get the root let root(ProductOccurrence) root = GetEditorRootOccurrences("ProductOccurrence").GetItem(1) //get the Occurrences whose type is Part and whose disciplines "AecWall" let occs(List) let predicate1(String) predicate1= DescriptionFilled? "(x.Reference:VPMReference).V_description.Length()<>0"; "(x.Reference:VPMReference).V_description.Length()==0" occs = root.Query("ProductOccurrence", predicate1) //set the color occs.Apply("ProductOccurrence", "x.SetAttributeString(\"Color\", \""+ColorName+"\")")

Running the action above will yield the following results:

Embedding Options In Actions

We can embed choices so that the end user may select from a dropdown menu.

Deploying Through Catalogs

Catalogs are a type of a PLMEntity that can hold references to elements: Features, VPMReferences, Engineering Templates, etc. They allow for recalling elements from a single place. Note that this is different from CATIA V5's Catalogs--called Component Families in 3DExperience.

Recalling A Catalog

Reusing the catalog is easily done by recalling it either by searching and opening it, or by adding it to the "My Favorites" list.

Deploying Through Data Setup

The next method makes use of the Administrator role, and can be only done by accessing the Default collaborative space.

Add a knowledge resource table, then add the action, and finally bind the table to the space you want. The table you bind to a space will be available only to that space. Except if you bind it to the Corporate space, it willl be available to all other spaces on your tenant. Note that it is necessary to assign a command name to the action-resource.

Adding A Tool Command In The UI

Restart CATIA into a production workspace, for exampleCommon Space, and navigate to the Customize command and add a UI icon as shown below:

Deploying To Multiple Users

Once the action is added to DataSetup and a UI icon is created, you'll notice that your CATSettings have been updated. The updated settings hold information about the toolbar changes you just made. To deploy to other users, you'll need to push those CATSettings from your machine to users directories where their CATIA Environment files point to. This depends on your organization's installation. Alternatively, you can push the settings files to a shared directory, and make sure that users Environment files point to it. The Environment variable that defines where CATIA's settings are picked from is CATUserSettingPath. Note that changing these settings will cause users to lose their existing custom-shortcuts and settings.

Source File

You can find the file containing the above script at the blog's repo

Tags: , ,

About : Maher Elkhaldi

Maher Elkhaldi is a senior applications engineer at Tesla Motors. He founded the 3DXAutomation blog to help make knowledge of programming CATIA easier to find, and contribute to the open-source community.

4 thoughts on “Deploying Automation”

  1. Hi,
    I am trying to share some features stored in DataSetup with a colleague of mine on his machine and I have a few questions about it:
    – The CATSettings mentioned in the post that we have to share (to copy from my machine to his) is the folder at the directory “AppData\Roaming\DassaultSystemes\CATSettings” ?
    – In the Data Setup page do I have to store the new Resource Table in the “Corporate” space or it’s enough to place in my own Collaborative Space?
    – My colleague needs the access to the Collaborative Space where the features have been created to call them from DataSetup Resource Table?

    Thank you very much!!
    Alessandro

    1. Thanks Alessando!
      -CATSettings will hold information about shortcuts and commands in your CATIA session. So if you want others to have the same settings, you will need to either copy your settings to their folder. or have their environment file variable CATUserSettingPath point to a directly that those settings. Typically a shared network location.
      -Id you store your resource in Corporate, it becomes available to all existing and new collaborative spaces. If you add it to other spaces, for example ProjectABC_space, that resource will be only available to that space.
      -I am not clear on your last question. If you want to call items from data setup, you’ll need to do InstantiateTemplate(“ResuorceTableName|featureName”, …). I plan on making a post on calling items from resources tables and catalogs 😉

  2. Hi Maher,
    I try to better explain my last question. Let say for example that I have created a “Product_A” and a correlated “Template_A” of it in “Collaborative Space A”. If I put the “Template_A” in a resource table in the DataSetup page binded in a “Collaborative Space B”, my colleague (who has the access only to “Collaborative Space B”) can’t see/use or call with an EKL Action that specific template if he hasn’t the access to the “Collaborative Space A” too. Is it correct?

    1. Hey Alessando, I have not tested that specific scenario, but I believe that you’re assumption is correct. That’s because an Eng. Template is a definition that creates a new VPM based on a source. So I would think that the source and definition should be accessible to the end user for them to be able to create instances of it.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.