Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...


When an object is called by its type within the OpenBrIM-App, the system navigates to library and find the object by type. Then, code lines are processed and all parameters except those with Role=”Input” are erased from memory. To retain the parameters and objects that should not be deleted must be defined in the export object. As a result, the parameters within the "Export" object are moved to the App's Source Code.

What if other intermediate parameters, which are not required for this user and which the App does not keep in its memory, are required for another object? That's when the "Export" object comes into play and when the code of an object written in the library runs through the App, it provides the input parameters to be taken, and the parameters in the "Export" to be transferred to the App in the same way, and thus the intermediate parameters go into the source code.
When the code of a Library object is executed in the App, it returns results based on the object's type. There are four types of results available in the App.

  • The first type of result that can be obtained is a 3D model, which is created using objects such as "Volume", "Line", and "Surface" (found in the Core Objects category).

  • The second type of result is obtaining CADD drawings, which is achieved using CADD objects or the "CADDFrom3D" object (found in the Core Objects category).

  • The third type of result is a specification check, which is performed using the "DesignCode" object.

  • The fourth type of result is the ability to perform finite element analysis, which is achieved using analysis and finite element objects.

  • An example of how the "Export" object connects the Library and App is as follows: In a Library object, certain intermediate parameters are calculated and stored in the "Export" object. These values are then passed to an App, where they are used in the source code to perform specific tasks, such as creating a 3D model or checking design specifications.

When two separate objects are created in the Library and used in an App, they function as follows:

  • The App requests the objects from the Library and retrieves them.

  • The objects are then processed according to their respective types, such as 3D modeling, CADD drawings, specification checks, or finite element analysis.

  • The input parameters for each object are deleted from memory, but any values in the "Export" object are transferred to the App's source code.

  • The objects then perform their designated functions in the App, using the transferred "Export" values and any other necessary parameters.

  • The objects return their respective results, such as a 3D model, CADD drawings, specification check results, or analysis results, to the App for further use.

It's important to note that the objects are independent of one another, meaning that the output of one does not affect the functioning of the other.

The After line by line processing of the code, parameters that do not have role="Input" are being erased from memory. For communication with other objects, all parameters and objects that need to be retained for this reason should be defined within "Export" so that they are not deleted. As a result, the parameters within the "Export" object are moved to the App's Source Code.

The operating of two separate Objects created in the Library in the OpenBrIM App:

Drawio
mVer2
zoom1
simple0
inComment0
custContentId2157248586
pageId2155413517
lbox1
diagramDisplayNameChart
contentVer5
revision5
baseUrlhttps://openbrim.atlassian.net/wiki
diagramNameUntitled Diagram-1674822797769.drawio
pCenter0
width722
links
tbstyle
height1021.5

Example:

Code Block
languagexml
   ...
   ...
    <O T="Export">
        <O N="Parameters" T="Group">
            <P N="Topelevation" V="depth" />
            <P N="ElevationDif" V="Topelevation+25" />
        </O>
        <O N="refline" T="Line" D="Reference Line">
            <O N="R1" T="Point" X="0" Y="0" Z="Topelevation" />
            <O N="R2" T="Point" X="length" Y="width" Z="Topelevation" />
        </O>
    </O>
</O>

The library code illustrated above exports a reference line named refline exports elevation parameters named Topelevation and ElevationDif. When the values of the object to be exported in the Library are written in the "Export" object, it appears in the Source Code in the App, except for the Role="Input" parameters.

Image Removed

...

this object called by its type in the App, the parameters and line object are exported to the project source code as demonstrated below.

Image Added

To view this example in the library, see(https://openbrim.org/platform/?application=inc&author=ParamML_Examples_OpenBrIM+Platform&obj=objidnopmup6rh6fjejdvfax1g&folder=Core+Objects)

Let’s see how library components are using other components' parameters or sub-objects that are exported to the source code;

Example:

This example consists of 3 different library component which are representing a pedestal, a flagpole and a flag to illustrate how these 3 objects are parametrically connecte.

Base Object : This object has 4 inputs which are the coordinates of reference point, width, length and depth of the base. It creates a 3D volume object from these inputs and exports a reference line which is a diagonal path of flagpole.

Code Block
<O N="ExportExampleObject1" T="Project" Category="Core Objects">
    <!-- created by ParamML Examples on 8/31/2023 -->
    <P N="Starting_Point" V="[1,2,3]" Role="Input" />
    <P N="Wf" V="20" D="Width of the foundation" Role="Input" />
    <P N="Lf" V="20" D="Length of the foundation" Role="Input" />
    <P N="Hf" V="2" D="Height of the foundation" Role="Input" />
    <O T="Volume">
        <P N="Opacity" V="0.5" />
        <O N="bottomN" T="Surface" X="Starting_Point[0]" Y="Starting_Point[1]" Z="Starting_Point[2]">
            <O T="Point" X="0" Y="0" Z="0" />
            <O T="Point" X="Wf" Y="0" Z="0" />
            <O T="Point" X="Wf" Y="Lf" Z="0" />
            <O T="Point" X="0" Y="Lf" Z="0" />
        </O>
        <O N="TopN" T="Surface" X="Starting_Point[0]" Y="Starting_Point[1]" Z="Starting_Point[2]+Hf">
            <O T="Point" X="0" Y="0" />
            <O T="Point" X="Wf" Y="0" />
            <O T="Point" X="Wf" Y="Lf" />
            <O T="Point" X="0" Y="Lf" />
        </O>
    </O>
    <O T="Export">
        <O N="RefLine" T="Volume" X="Starting_Point[0]" Y="Starting_Point[1]" Z="Starting_Point[2]">
            <O N="Point1" T="Point" X="0" Y="0" Z="Hf" />
            <O N="Point2" T="Point" X="Wf" Y="Lf" Z="Hf" />
        </O>
        <P N="FoundCoord" V="toglobal(RefLine)" />
        <P N="midpoint" V="onliner(FoundCoord,0.5)" />
    </O>
</O>
Image Added

To vew this example in library, see https://openbrim.org/platform/?application=inc&author=ParamML_Examples_OpenBrIM+Platform&obj

...

=objidujk37rmwc8so5bketj81ii

Flagpole : This object requires a base object whose type isExportExampleObject1 and other geometric inputs to create a pedestal and a pole for flag. Also there are 2 offset inputs to change the location of the pedestal and pole on the base by using the reference line that is exported from ExportExampleObject1. Finally this object also exports reference line for flag object.

Code Block
<O N="ExportExampleObject2" T="Project" Category="Core Objects">
    <!-- created by ParamML Examples on 8/31/2023 -->
    <P N="BaseObj" V="EEO" T="ExportExampleObject1" Role="Input" />
    <O T="ParamInfo" Min="1" Max="1" Required="1" Pick="1" Param="BaseObj" />
    <O N="GeoInputs" T="Group">
        <P N="width_pedestal" V="5" D="Width of pedestal" Role="Input" Category="GeoInputs" />
        <P N="height_pedestal" V="1" D="Height of pedestal" Role="Input" Category="GeoInputs" />
        <P N="R" V="1" D="Radius of Flagpole" Role="Input" Category="GeoInputs" />
        <P N="thickness" V="0.25" D="Thickness of Flagpole" Role="Input" Category="GeoInputs" />
        <P N="h2" V="10" D="Height of Flagpole" Role="Input" Category="GeoInputs" />
        <P N="xoff" V="0" D="Offset in X direction" Role="Input" Category="GeoInputs" />
        <P N="yoff" V="0" D="Offset in Y direction" Role="Input" Category="GeoInputs" />
    </O>
    <O N="Pedestal" T="Volume">
        <P N="Opacity" V="0.7" />
        <O N="Bottomp" T="Surface" X="BaseObj.midpoint[0]+xoff" Y="BaseObj.midpoint[1]+yoff" Z="BaseObj.midpoint[2]">
            <O T="Point" X="-width_pedestal/2" Y="-width_pedestal/2" Z="0" />
            <O T="Point" X="width_pedestal/2" Y="-width_pedestal/2" Z="0" />
            <O T="Point" X="width_pedestal/2" Y="width_pedestal/2" Z="0" />
            <O T="Point" X="-width_pedestal/2" Y="width_pedestal/2" Z="0" />
        </O>
        <O N="Topp" T="Surface" X="BaseObj.midpoint[0]+xoff" Y="BaseObj.midpoint[1]+yoff" Z="BaseObj.midpoint[2]">
            <O T="Point" X="-width_pedestal/2" Y="-width_pedestal/2" Z="height_pedestal" />
            <O T="Point" X="width_pedestal/2" Y="-width_pedestal/2" Z="height_pedestal" />
            <O T="Point" X="width_pedestal/2" Y="width_pedestal/2" Z="height_pedestal" />
            <O T="Point" X="-width_pedestal/2" Y="width_pedestal/2" Z="height_pedestal" />
        </O>
    </O>
    <O N="FlagPole" T="Group">
        <P N="Opacity" V="0.7" />
        <O N="L" T="Line">
            <O T="Point" X="BaseObj.midpoint[0]+xoff" Y="BaseObj.midpoint[1]+yoff" Z="BaseObj.midpoint[2]+kalinlik" />
            <O T="Point" X="BaseObj.midpoint[0]+xoff" Y="BaseObj.midpoint[1]+yoff" Z="BaseObj.midpoint[2]+h2+kalinlik" />
            <O T="Section">
                <O T="Circle" Radius="R" />
                <O T="Circle" Radius="R-thickness" IsCutout="1" />
            </O>
        </O>
    </O>
    <O T="Export">
        <O N="RefLine2" T="Line">
            <O N="PT1" T="Point" X="BaseObj.midpoint[0]+xoff+R/sqrt(2)" Y="BaseObj.midpoint[1]+yoff+R/sqrt(2)" Z="BaseObj.midpoint[2]+kalinlik" />
            <O N="PT2" T="Point" X="BaseObj.midpoint[0]+xoff+R/sqrt(2)" Y="BaseObj.midpoint[1]+yoff+R/sqrt(2)" Z="BaseObj.midpoint[2]+h2+kalinlik" />
        </O>
        <P N="PoleCoord" V="toglobal(RefLine2)" />
        <P N="midpoint2" V="onliner(PoleCoord,0.5)" />
    </O>
    <O T="Private">
        <O N="EEO" T="ExportExampleObject1">
            <P N="Starting_Point" V="[1,2,3]" />
            <P N="Wf" V="20" D="Width of the foundation" />
            <P N="Lf" V="20" D="Length of the foundation" />
            <P N="Hf" V="2" D="Height of the foundation" />
            <P N="FoundCoord" V="toglobal(RefLine)" />
            <P N="midpoint" V="onliner(FoundCoord,0.5)" />
            <O N="RefLine" T="Volume" X="Starting_Point[0]" Y="Starting_Point[1]" Z="Starting_Point[2]" Exported="1">
                <O N="Point1" T="Point" X="0" Y="0" Z="Hf" />
                <O N="Point2" T="Point" X="Wf" Y="Lf" Z="Hf" />
            </O>
        </O>
    </O>
</O>
Image Added

To view object in the library, see https://openbrim.org/app/?incubator=1&author=ParamML_Examples_OpenBrIM+Platform&obj=objidcgapy250iyjfs6dqjskfm

Flag : This object reuires a flag pole object whose type is ExportExampleObject2 and other geometric inputs to create flag. Also there is flag height input to change the flan location in Z axis by using the reference line that is exported from ExportExampleObject2.

Code Block
<O N="ExportExampleObject3" T="Project" Category="Core Objects">
    <!-- created by ParamML Examples on 8/31/2023 -->
    <P N="be" V="4" D="Flag Width" Role="Input" />
    <P N="bb" V="2" D="Flag Length" Role="Input" />
    <P N="by" V="100" D="Flag Height" Role="Input" />
    <P N="PoleObj" V="EEO2" T="ExportExampleObject2" Role="Input" />
    <O T="ParamInfo" Min="1" Max="1" Required="1" Pick="1" Param="PoleObj" />
    <O N="Flag" T="Surface" X="PoleObj.midpoint2[0]" Y="PoleObj.midpoint2[1]" Z="(PoleObj.midpoint2[2]-PoleObj.h2/2)+(PoleObj.h2-bb)*(by/100)">
        <P N="Opacity" V="0.8" />
        <O T="Point" X="0" Y="0" Z="0" />
        <O T="Point" X="be" Y="be" Z="0" />
        <O T="Point" X="be" Y="be" Z="bb" />
        <O T="Point" X="0" Y="0" Z="bb" />
    </O>
    <O T="Private">
        <O N="EEO2" T="ExportExampleObject2">
            <P N="BaseObj" V="EEO1" T="ExportExampleObject1" />
            <P N="width_pedestal" V="5" D="Width of pedestal" />
            <P N="height_pedestal" V="1" D="Height of pedestal" />
            <P N="R" V="1" D="Radius of Flagpole" />
            <P N="thickness" V="0.25" D="Thickness of Flagpole" />
            <P N="h2" V="10" D="Height of Flagpole" />
            <P N="xoff" V="0" D="Offset in X direction" />
            <P N="yoff" V="0" D="Offset in Y direction" />
            <P N="PoleCoord" V="toglobal(RefLine2)" />
            <P N="midpoint2" V="onliner(PoleCoord,0.5)" />
            <O N="RefLine2" T="Line" Exported="1">
                <O N="PT1" T="Point" X="BaseObj.midpoint[0]+xoff+R/sqrt(2)" Y="BaseObj.midpoint[1]+yoff+R/sqrt(2)" Z="BaseObj.midpoint[2]+kalinlik" />
                <O N="PT2" T="Point" X="BaseObj.midpoint[0]+xoff+R/sqrt(2)" Y="BaseObj.midpoint[1]+yoff+R/sqrt(2)" Z="BaseObj.midpoint[2]+h2+kalinlik" />
            </O>
        </O>
        <O N="EEO1" T="ExportExampleObject1">
            <P N="Starting_Point" V="[1,2,3]" />
            <P N="Wf" V="20" D="Width of the foundation" />
            <P N="Lf" V="20" D="Length of the foundation" />
            <P N="Hf" V="2" D="Height of the foundation" />
            <P N="FoundCoord" V="toglobal(RefLine)" />
            <P N="midpoint" V="onliner(FoundCoord,0.5)" />
            <O N="RefLine" T="Volume" X="Starting_Point[0]" Y="Starting_Point[1]" Z="Starting_Point[2]" Exported="1">
                <O N="Point1" T="Point" X="0" Y="0" Z="Hf" />
                <O N="Point2" T="Point" X="Wf" Y="Lf" Z="Hf" />
            </O>
        </O>
    </O>
</O>

Image Added

To view this object in library, see https://openbrim.org/app/?incubator=1&author=ParamML_Examples_OpenBrIM+Platform&obj=objidbjxpqt5dcrthlqtafahlfb

Beware that PoleCoord parameter in ExportExampleObject2 is not used directly in ExportExampleObject3 however it is still needed to be exported to compute the value of midpoint2 parameter in ExportExampleObject2 that is used in the calculations of ExportExampleObject3.

This example is also a good ilustration of using “Private”, which allows developer to call instances of required objects to the project to simplfy their tasks while simultaneously preventing the creation of those instances within the application.