Set the Border Style of Boundary Elements with the EA-API

With the EA-API it is possible to modify the model within EA programmatically. In Addition to that it is also possible to influence the project settings and the UI of EA.

The EA help provides a comprehensive description of the API properties and operations. Furthermore, EA provides a standard set of example scripts (open in main menu [Tools | Scripting]) in the “Local Scripts” package.

However, some EA elements have special properties, which are not accessible via a dedicated property or operation. These special properties may be set with the generic element.Properties property.

 

 

For instance, the Boundary-Element has a property BorderStyle, which can be set via the element.Properties:

var element = [reference to a Boundary element]; // element.Type == “Boundary”
element.Properties.Item("BorderStyle").Value = "Solid";
element.Update();
Repository.AdviseElementChange( element.ElementID );
 
This changes create a boundary with solid background from a normal boundary element.
 

Posted in Tips & Tricks