Export object, which is only used in OpenBrIM Library, allows necessary parameters and objects of a library object to be exported to a project created in OpenBrIM App. This keeps the project simple with lesser ParamML code lines rather than adding the whole library object with hundreds or thousands of ParamML code lines (e.g., graphics, FEA, code check, etc.).
Example
Example 1:
In OpenBrIM Library, create an object definition as shown below.
<O N="Export1" T="Project"> <P N="width" V="5" Role="Input" /> <P N="height" V="5" Role="Input" /> <P N="area" V="width*height" /> </O>
and another object with Export object.
<O N="jgExport2" T="Project"> <P N="width" V="5" Role="Input" /> <P N="height" V="5" Role="Input" /> <O T="Export"> <P N="area" V="width*height" /> </O> </O>
Switch to OpenBrIM App and create a new project. Hit the Add obj icon. Select BrIM Incubator, your name, and Export1 from the drop down menus respectively. Name the Export1 object E1 and hit ADD.
Repeat the previous procedure to add Export2 object. Name the object E2.
In Settings, go to code tab.
As seen in the code above, area parameter is not seen in E1 object while E2 object has it. This is the purpose of Export object which is to include objects or parameters of an object that are essential to the project.
By default, parameters with attribute Role="Input" is included to objects added to OpenBrIM App.
In the OpenBrIM App code view, add the following code shown below to verify that the area for both objects are greater than 0.
<O N="E1 Area" T="Verify" Criteria="E1.area .GT. 0" /> <O N="E2 Area" T="Verify" Criteria="E2.area .GT. 0" />
In the status report, E1 Area verify object fails while E2 Area verify object passes. This is because the area parameter in Export1 object is not enclosed in an Export object and cannot be accessed. Therefore, parameters or objects that needed to be accessed in the project need to be put in an Export object.
Go back to OpenBrIM Library and create another object defintion as shown below.
<O N="Export3" T="Project"> <P N="Exp1" T="jgExport1" V="E1" Role="Input" D="An export object with width and height" /> <O N="Ensure Valid area" T="Verify" Criteria="Exp1.area .GT. 0" /></O>
Add Export3 object in the previous project created in OpenBrIM App. In the status report it can be seen that the verify object for the Export3 object fails too. This is because it is referred to a parameter (area parameter of E1 object) that is not that is not exported to the project in OpenBrIM App.But if the value of Exp1 will be changed to E2 (V="E2") the verify object will pass because the area parameter of E2 object is accessible.
Example 2:
Shown below is an invalid object definition.
<O N="Export4" T="Project"> <P N="width" V="5" Role="Input" /> <P N="height" V="5" Role="Input" /> <P N="constant" V="3.14" D="constant number" /> <O T="Export"> <P N="area" V="width*height*constant" /> </O></O>
The area parameter will have no access to constant parameter because it is not an input parameter nor included in the export object.
The object definition should be as shown below.
<O N="Export5" T="Project"> <P N="width" V="5" Role="Input" /> <P N="height" V="5" Role="Input" /> <O T="Export"> <P N="constant" V="3.14" D="constant number" /> <P N="area" V="width*height*constant" /> </O></O>