Versions Compared

Key

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

This page contains EDMInterface API sample code to show how to exploit the powerful features of EDMqueryMethodsEDMruleMethods. To run these samples, you need to create an EDMdatabase and compile the following schemas.

...

Section


Column
width30px

Insert excerpt
US:_icon_QEXREX(30px)
US:_icon_QEXREX(30px)
nopaneltrue


Column
width120px

Insert excerpt
US:_f_Ifc_Samples_01.qexrex
US:_f_Ifc_Samples_01.qexrex
nopaneltrue


Column
Defines the EDMqueryMethods CheckModelCapacityUsed(), CheckEDMserverVersion() and GetMaxModelInstancesEDMruleSchema Ifc_Rule_Samples_01 with the EDMruleMethod CheckIfcRootObjectGlobalId(). Extends the IFC2x3 EXPRESS Schema


You will also need to import the following data set into the EDMmodel named IFC_WALL_0102 in the DataRepository

 Sample population with one instance of IFCWALLSTANDARDCASE, with simple geometry
Section


Column
width30px

Insert excerpt
US:_icon_STP(30px)
US:_icon_STP(30px)
nopaneltrue


Column
width120px
 
Insert excerpt
Column
width30px
Insert excerpt
US:_icon_STP(30px)US:_icon_STP(30px)
nopaneltrue
Column
width120px
 
Insert excerpt
US:_f_IfcWall_01.ifcUS:_f_IfcWall_01.ifc
nopaneltrue
Column

Sample population with one instance of IFCWALLSTANDARDCASE, identified by a GUID

Section
US:_f_IfcWall_02.ifc
US:_f_IfcWall_02.ifc
nopaneltrue


Column

Sample population with three instances of IFCWALLSTANDARDCASE, with identified by duplicate GUIDs

Section
Column
width30px
Insert excerpt
US:_icon_STP(30px)US:_icon_STP(30px)
nopaneltrue
Column
width120px
Insert excerpt
US:_f_IfcWall_03.ifcUS:_f_IfcWall_03.ifc
nopaneltrue
Column


 

...

Sample 1: EDMruleMethod with logical output

This sample executes an EDMruleMethod with no input parameters and returns a single logical validation result (TRUE/FALSE/UNKNOWN). To run this sample, you need the EDMruleSchema IFC_Rule_Samples_01. You also need to import the sample population IfcWall_02.ifc.

Section


Column
width30px

Insert excerpt
US:_icon_STPC(30px)
US:_icon_STPC(30px)
nopaneltrue


column
Column
width120px
 
Insert excerpt
US:_f_IfcWall_04.ifcxc_IfcEDMruleMethod01
US:_f_IfcWall_04.ifcxc_IfcEDMruleMethod01
nopaneltrue


 

...

Sample

...

2: EDMruleMethod with Expression Logging 

This sample shows how to execute an EDMqueryMethod and pick up the result in a QueryResult table allocated in the calling clients heap memory. In the sample, input arguments to the Query are provided as SELECT type parametersspecify expression logging of the EDMvirtualMachine that executes an EDMruleMethod. To run this sample, you need to have the EDMquerySchema EDMruleSchema IFC_QueryRule_Samples_01 installed the EDMmodelServer. You also need to import the sample population IfcWall_0102.ifc. Note that the QueryResult table shows instances of the VIEW_ENTITY type defined in the EDMqueryShema. 

Section


Column
width30px

Insert excerpt
US:_icon_C(30px)
US:_icon_C(30px)
nopaneltrue


Column
 
Insert excerpt
US:_xc_IfcEDMqueryMethod01IfcEDMruleMethod02
US:_xc_IfcEDMqueryMethod01IfcEDMruleMethod02
nopaneltrue


 

...

Sample

...

3:

...

 EDMruleMethod with XML

...

String I/O  

This sample executes an EDMqueryMethod. Input arguments to the Query are provided through an XML file. The output is returned as a QueryTable written to the an XML EDMruleMethod with input parameters and file mapping between the logical file name 'result' and a file on the calling clients local file system. To run this sample, you need to have the EDMquerySchema EDMruleSchema IFC_QueryRule_Samples_01 installed the EDMmodelServer. You also need to import the sample population IfcWall_0102.ifc. 

Section


Column
width30px

Insert excerpt
US:_icon_C(30px)
US:_icon_C(30px)
nopaneltrue


Column
 
Insert excerpt
US:_xc_IfcEDMqueryMethod02IfcEDMruleMethod03
US:_xc_IfcEDMqueryMethod02IfcEDMruleMethod03
nopaneltrue



...

Sample

...

This sample executes an EDMqueryMethod. Input arguments to the Query are provided through an XML strings. The output is returned as a QueryTable written to the an XML string allocated in the calling clients heap memory. This sample also use file mapping to have the EDMqueryMethod write a result file directly in the calling clients local fils system.

...

4: Processing the EDMvalidation Result Model  programatically

Whenever vaildating a data model a generic diagnostic file with all violations is produced. It might, however, be that one in a certain context wants to apply a filter.

Some types of errors might be critical in a certain context  whereas others can be ignored. Moreover, it can also be helpful to show context specific identification of the the instances that cause the problem, in order to pin point the problem.

Therefore one can switch on an option to produce a so called validation result model whenever validating a data model. After the validation is finished, the  validation result model  can be processed programatically.

The example is written in Java (edom3). A detailed documentation is found in the header of the Validation class in the example.

Section


Column
width30px

Insert excerpt
US:_icon_CJava(30px)
US:_icon_CJava(30px)
nopaneltrue


true

Java documentation for the example,  Zip file with complete Java project

Column
 
Insert excerpt
US:_xc_IfcEDMqueryMethod03US:_xc_IfcEDMqueryMethod03nopanel