3DX Development Chronicles

ekl

#ekl #bestpractice #kac

cover document

Note that you will need a registered account to access the file.

#ekl #bestpractice #python

Until now, you could use Python via the COM interface for automation. There are wrappers for Catia V5 pycatia and for 3DEXPERIENCE experience. In the Templates Rules Designer, you can now create Python scripts using the EKL language. You can use external packages from PyPI (make sure to use the correct version), or even create your own packages. If you want to take it further, you can create a package that uses automation and call it from a Python script. Spoiler alert: the selection methods do not work.

Would you like to learn more? Then check out the best practices on Python scripting in 3DEXPERIENCE!

cover document

Note that you will need a registered account to access the file.

#3dx #v5 #ekl

A ternary operation in programming is a concise way to perform conditional evaluations. The ternary operator takes three operands and is typically used as a shorthand for an if-else statement.

Syntax

The general syntax of a ternary operation is:

condition ? expression_if_true ; expression_if_false

Explanation

  • condition: This is the expression that is evaluated. If it evaluates to true, the first expression is executed; if false, the second expression is executed.
  • expression if true: This expression is returned if the condition is true.
  • expression if false: This expression is returned if the condition is false.

Example

Create a Boolean parameter “switch” with value true Create a Point.1 with coordinates (10, 0, 0) Create a Point.2 with coordinates (-10, 0, 0) Create a parameter of type point and in the formula editor type:

switch == true ? Point.1 ; Point.2

You might need to select the points from the tree to be sure the complete path is caught

In this example, the condition checks if switch is true or false. If true, it assigns “Point.1” to the point parameter, otherwise, it assigns “Point.2”

It can be used directly in formulas, making it useful for assignments. For complex conditions, a rule or reaction can still be used.

#ekl #bestpractice

EKL is an interpreted, object-oriented programming language that builds upon the DS C++ automation programming language. It provides a robust development environment that includes knowledge packages, types, methods, and functions, enabling users to easily customize and automate task execution on both the client and server sides.

This feature already existed in Catia V5, but Dassault Systèmes has significantly enhanced the language for 3DEXPERIENCE.

In the following document, you will find the fundamentals of the language, details about the editor, instructions on how to use it in actions, and guidance on storing code in libraries, among other topics.

cover document

Note that you will need a registered account to access the file.

You can sort the blog posts by different topics:

#vba #ekl #bestpractice #v5 #3dx #python #kac