IFCImporterObj
- Last UpdatedNov 17, 2025
- 5 minute read
This section defines the API for the PML object that performs the import operation.
|
NAME |
RESULT |
ACTION |
|---|---|---|
|
getBucketSize() |
REAL |
Gets the number of imported elements per ZONE. |
|
getUseBucketSize |
BOOLEAN |
Get Bucket Size usage flag. |
|
getCacheFacets() |
BOOLEAN |
Get CTOL usage flag. |
|
getDbTarget() |
DBREF |
Get DBREF of SITE to receive model. |
|
getGroupWorld() |
DBREF |
Get DBREF of GPWL to receive parallel model. |
|
getLogDetail() |
REAL |
Set logging levels. |
|
getLogDetailText() |
STRING |
Converts logging level into equivalent STRING. 1. NONE 2. BRIEF 3. FULL 4. DEBUG |
|
getLogFile() |
STRING |
Get full path name of log file. |
|
getPrefix() |
STRING |
Get the naming prefix. |
|
getResult() |
STRING |
Get result of Import operation. |
|
getImportStatus() |
STRING |
Get a fuller description of import status. |
|
getRefDatum() |
DBREF |
Get the Reference Datum. |
|
getScale() |
REAL |
Get the transform scale factor. |
|
getSource() |
STRING |
Get full path name of source file or folder. |
|
getSrcFolderFlg() |
BOOLEAN |
Get source folder flag. |
|
getTolerance() |
REAL |
Get CTOL value used for faceting. |
|
getUserPostProcessor() |
STRING |
Get the User-editable post-processor file name. |
|
getUserPreProcessor() |
STRING |
Get the User-editable pre-processor file name. |
|
ifcimporterobj() |
NO RESULT |
Constructor. |
|
import() |
STRING |
Imports the data and returns a result string. |
|
postProcess() |
NO RESULT |
Supplied post-processing function. |
|
setBucketSize(REAL) |
NO RESULT |
Sets the number of imported elements per ZONE. |
|
setUseBucketSize(BOOLEAN) |
NO RESULT |
Set Bucket Size usage flag. |
|
setCacheFacets(BOOLEAN) |
NO RESULT |
Set CTOL usage flag. |
|
setDbTarget(DBREF) |
NO RESULT |
Set DBREF of SITE to receive model. |
|
setGroupWorld(DBREF) |
NO RESULT |
Set DBREF of GPWL to receive parallel model. |
|
setLogDetail(REAL) |
NO RESULT |
Set logging levels. |
|
setLogFile(STRING) |
NO RESULT |
Set full path name of log file. |
|
setPrefix( STRING ) |
NO RESULT |
Set the naming prefix. |
|
setRefDatum( DBREF ) |
NO RESULT |
Set the Reference Datum. |
|
setRefDatumByName(STRING) |
NO RESULT |
Sets the Reference Datum by displayed name. |
|
setRefDatumOption(BOOLEAN) |
NO RESULT |
Set flag indicating use of Reference Datum (true/false). |
|
setScale( REAL ) |
NO RESULT |
Set the transform scale factor. |
|
setSource(STRING) |
NO RESULT |
Set full path name of source file or folder. |
|
setSrcFolderFlg(BOOLEAN) |
NO RESULT |
Set True if source is a folder. |
|
setTolerance(REAL) |
NO RESULT |
Set CTOL value used for faceting. |
|
setUserPostProcessor() |
STRING |
Set the User-editable post-processor file name. |
|
setUserPreProcessor() |
STRING |
Set the User-editable pre-processor file name. |
|
splitIntoBuckets(BOOLEAN) |
NO RESULT |
Split imported ZONE into buckets based on the bucket size, folder flag and source file name stored in imported ZONE description. |
|
userPostProcess( STRING ) |
NO RESULT |
Plugger for user post processing pml function. |
The member data for the object are as follows.
|
NAME |
RESULT |
STATUS |
ACTION |
|---|---|---|---|
|
source |
STRING |
SETTABLE |
Full path name of source file or folder. |
|
srcFolderFlg |
BOOLEAN |
SETTABLE |
True if source is a folder. |
|
dbTarget |
DBREF |
SETTABLE |
Refno of SITE to receive model. |
|
groupWorld |
DBREF |
SETTABLE |
Refno of GPWL for parallel hierarchy. |
|
refDatum |
DBREF |
SETTABLE |
Reference Datum for import transformations. |
|
scale |
REAL |
SETTABLE |
Model scale factor. |
|
cacheFacets |
BOOLEAN |
SETTABLE |
True if using facet tolerance value. |
|
tolerance |
REAL |
SETTABLE |
Facet tolerance value. |
|
prefix |
STRING |
SETTABLE |
Model naming prefix for post-processing. |
|
logFile |
STRING |
SETTABLE |
Full path name of log file. |
|
logDetail |
REAL |
SETTABLE |
Logging levels: 1. None 2. Low 3. Medium 4. High |
|
result |
STRING |
GETTABLE |
Short result text. |
Below is an example of using the object in User-written PML.
-- create importer object
!importer = object IFCIMPORTEROBJ()
-- configure the object
!importer.setCacheFacets(FALSE)
!importer.setDbTarget(=2013286676/296521 )
!importer.setLogDetail(2)
!importer.setLogFile(|D:\NIST_analysis_models\Duplex_A_20110907.log| )
!importer.setSource(|D:\NIST_analysis_models\Duplex_A_20110907.ifc|)
!importer.setSrcFolderFlg(FALSE)
!importer.setTolerance(1mm)
!importer.setPrefix( |TestModel| )
!importer.setRefDatumOption(TRUE)
!importer.setRefDatumByName(|IFCREVIT|)
-- import
!result = !importer.import()
-- post Process
!importer.postProcess()
-- output result
!!alert.message( !importer.getImportStatus( ) )
-- Process model after import
!importer.userPostProcess(|userPostProcess|)
Customise SUBE Size
The bucket splitting function is used to split the imported ZONE into a series of smaller SUBEs with a defined number of child elements. The default SUBE size of 100 can be customized if the import process is being performed from the command line. A value of less than 25 or more than 1000 cannot be entered. These are hard coded limits. For example:
!importer = object IFCIMPORTEROBJ( )
!importer.setUseBucketSize( true )
!importer.setBucketSize( 50 )
!importer.splitIntoBuckets( true )
The same core bucket splitting function is used to create multiple SUBEs and name the subsequent SUBEs based on the description of the original SUBE. This standalone function can also be called from the Command window to operate on elements other than ZONEs.
define function !!SplitIntoBuckets( !ref is DBREF, !bucketSize is REAL ) is ARRAY
For example, in the Command window or a PML file, if !ref is the reference number of a SUBE, and the required !bucketSize is 50 ().
!list = !!SplitIntoBuckets( !ref, 50)
The function is not SUBE specific and can be used to partition any element.
Model Prefix
Use the setPrefix function to define the model naming prefix that is used in the naming algorithm.
setRefDatumByName
This function call is to use the correct Reference Datum for applying transformations to the imported model. Internally, in the Application Data World the elements have a special suffix of -HDR which is not displayed.
!importer.setRefDatumByName(|IFCREVIT|)
The command above tells the importer to use the Reference Datum /IFCREVIT-HDR as its transformation data.
To use another ZONE that is outside the Application Data World, and is not controlled by this UI, you can set the Reference Datum using its DB Reference Number. For example:
!importer.setRefDatum(!refZone.DBREF())
Import Pre- and Post-Processing Functions
There is scope to define additional operations before and after importing a model. These are pre- and post-processing functions that might operate on the model before or after it has been imported. User-defined pre- and post-processing functions can be called during the data transfer process.
Template functions called userPreImpProcess.pmlfnc and userPostImpProcess.pmlfnc are supplied. The supplied default templates are called automatically from the Graphical User Interface post-process function. If the PML importer object is used, it is possible to provide the same additional functionality as required but they must be called manually when using the importer object.
Note:
The templates do not do anything, but it is possible to use them as a framework for
your own requirements.
These can be invoked using the commands:
!importer.userPreProcess()
!importer.userPostProcess()
Alternatively, you may provide your own functions and inject them into the import process. This is achieved by providing a function or even a series of similar functions, <userFunction>.pmlfnc, for example, IFCPostProcessing.pmlfnc, in the PML search path and then plugging it or them into the System using the command line. These functions take one argument and must handle all PML errors internally. The functions return a string result value containing whatever message is to be transmitted to the running PML application. The template PML functions provide an example of how to structure the function.
These can be defined in the importer object as below, but there are defaults of:
-
UserPreProcessor = |userPreImpProcess|
-
UserPostProcessor = |userPostImpProcess|
For example:
!importer = object IFCIMPORTEROBJ( )
!importer.setUserPreProcessor( |IFCPreProcessing| )
The string values are used to construct a function name, for example, userPreImpProcess.pmlfnc, which the system will attempt to invoke. The import process will not fail if these functions are not found. They are normal PML functions that must be available in the PML search path. A PML REHASH ALL command might be necessary to refresh the PML index files. All error handling must be contained in the files themselves.
When using the PML importer object directly, there are API functions on the importer object to set and get these values.
-
define method .setUserPreProcessor( !userPreProcessor is STRING )
-
define method .getUserPreProcessor( ) is STRING
-
define method .setUserPostProcessor( !userPostProcessor is STRING )
-
define method .getUserPostProcessor( ) is STRING
For example:
!importer = object IFCIMPORTEROBJ( )
!importer.setUserPreProcessor( |IFCPreProcessing| )
!importer.userPreProcess()
!importer.import()
!importer.setUserPostProcessor( |IFCPostProcessing| )
!importer.userPostProcess()
Please note that a parameter has been added to pre- or post-processing User function signatures to give User-access to the importer object itself. Note also that the User-definable functions must have a signature similar to the ones below, with the single parameter to the importer object. With the importer object, all the API functions become available within the pre- and post-processing functions.
-
define function !!userPostImpProcess( !importer is IFCIMPORTEROBJ ) is STRING
-
define function !!userPreImpProcess( !importer is IFCIMPORTEROBJ ) is STRING