Support site for Simplebim users
simplebim Command Line API

The simplebim® command line API can be used for importing IFC, applying a template and exporting IFC. The number and order of the command line parameters is significant. If folder or file names contain spaces the name must be enclosed in quotes. 

 

Importing IFC

Importing IFC with template

Exporting IFC

Exporting IFC silent

Batch Processing with a Script File

 


Importing IFC

Starts simplebim® and imports the specified file into the Editor model view using the full IFC import.

Syntax

Simplebim7.exe ImportFile

Simplebim6.exe ImportFile 

Simplebim5.exe ImportFile 

Parameters

ImportFile The IFC file (with full path) to import.

Example

Simplebim7.exe "C:\My Files\In.ifc" 


Importing IFC with template

Starts simplebim®, imports the specified file into the Editor model view using the full IFC import and applies the specified template.

Syntax

Simplebim7.exe ImportFile TemplateFile

Simplebim6.exe ImportFile TemplateFile 

Simplebim5.exe ImportFile TemplateFile 

Parameters

ImportFile The IFC file (with full path) to import.
TemplateFile The simplebim® template to apply.

Example

Simplebim7.exe "C:\My Files\In.ifc" "C:\My Files\Template.xls" 


Exporting IFC

Starts simplebim®, imports the specified file into the Editor model view using the full IFC import, applies the specified template and exports the result to the specified IFC file. 

Syntax    

Simplebim7.exe ImportFile TemplateFile ExportFile

Simplebim6.exe ImportFile TemplateFile ExportFile 

Simplebim5.exe ImportFile TemplateFile ExportFile 

Parameters

ImportFile The IFC file (with full path) to import.
TemplateFile The simplebim® template (with full path) to apply to the imported IFC model
ExportFile The file (with full path) of the exported IFC file.

Example

Simplebim7.exe "C:\My Files\In.ifc" "C:\My Files\Template.xls" "C:\My Files\Out.ifc" 


Exporting IFC silent

Starts simplebim®, imports the specified file into the Editor model view using the full IFC import, applies the specified template, exports the result to the specified IFC file and closes simplebim. During the operation simplebim®  runs minimized. 

Syntax    

Simplebim7.exe ImportFile TemplateFile ExportFile Close

Simplebim6.exe ImportFile TemplateFile ExportFile Close 

Simplebim5.exe ImportFile TemplateFile ExportFile Close 

Parameters

ImportFile The IFC file (with full path) to import.
TemplateFile The simplebim® template (with full path) to apply to the imported IFC model
ExportFile The file (with full path) of the exported IFC file.
Close Including the keyword Close as the last parameter instructs simplebim to run minimized and close itself once the operation is completed.

Example

Simplebim7.exe "C:\My Files\In.ifc" "C:\My Files\Template.xls" "C:\My Files\Out.ifc" Close 


Batch processing with a script file

Processing of models can be further automated with a script file that is passed to simplebim® as a parameter 

Syntax    

   

Simplebim7.exe ScriptFile

Simplebim6.exe ScriptFile

Simplebim5.exe ScriptFile

 

The file extension of the script file is .sbs (simplebim script). The file is a simple ASCII file with one command on each line. The commands are processed in the order they appear in the file. In order to run silently the script file must end with a Close command. The # character at the start of a line denotes a comment.

 

Commands

Variable=

New in simplebim 6.1. You can define any number of variables that consist of a variable name and value. When the script is parsed and the variable name in the format %NAME% is found anywhere in the script, it is replaced with the value you have defined. Variable names are case sensitive. Using variables makes it easier to adapt your script to new situations for example a new project.

Variable=NAME=value

The variable %SCRIPT_PATH% is always defined automatically and has the full path of the script file you are running as the value.

Import=

The IFC file (with full path) to import

Open=

The Cube file (with full path) to open

Apply=

The simplebim® template (with full path) to apply to the imported IFC model

NOTE: You may apply several templates in sequence to the same model

New in simplebim 6.1. You can define variables that are passed to the template you apply using the same syntax as when you run tools. In the template, use the syntax %NAME% anywhere and the name of the parameter is replaced with the value of the parameter. This reduces the number of template files you have to create because you can make a generic template that you configure with parameters.

Run=

The GUID or name of the tool that should be run. The tool can optionally be configured using the following syntax   

Run=ToolNameOrGuid|key1|key2=value2|key3=value

Merge=

The IFC file (with full path) to merge to the already imported or opened model. Merge can optionally be configured using the following syntax

Merge=File|key1|key2=value2|key3=value3

New in simplebim 6.1. You can use wildcards in the File parameter. For example C:\Script Files\*.ifc When the script is parsed the directory specified in the File parameter is scanned for files that match the pattern and a separate command is automatically created for each file. This makes it easier to re-use script files with different combinations of file that need to be merged.

The supported configurations are

Key

Value(s)

Description

MERGE_TYPE

FULL

CREATELOCATIONPRISMS

READLOCATIONPRISMS

Default

Creates 3D location prisms from footprints

Reads 3D location prisms

MERGE_SITES

n/a

The resulting model should have only one site

MERGE_BUILDINGS

n/a

The resulting model should have only one building. Can only be used with MERGE_SITES

MERGE_BUILDING_STOREYS_BY_NAME

n/a

Merge building storeys by name. Can only be used with MERGE_BUILDINGS. Can be used together with MERGE_BUILDING_STOREYS_BY_ELEVATION

MERGE_BUILDING_STOREYS_BY_ELEVATION

n/a

Merge building storeys by elevation. Can only be used with MERGE_BUILDINGS. Can be used together with MERGE_BUILDING_STOREYS_BY_NAME

BY_BUILDINGSTOREYS

ON

OFF

 

Default

EXTENT_LOWEST_BUILDINGSTOREY

ON

OFF

 

                       

Export =

The file (with full path) of the exported IFC file.

Save =

The file (with full path) of the saved Cube file

Delete =

The file (with full path) of the file to delete. The user will not be prompted to confirm the delete operation.

StartLog=

The file (with full path) of the log file

StartLog may appear anywhere after the first Import and the final Close. You can write a separate log for each operation, one log for the whole script or for any sequence of operations in between.

SaveLog

Saves the log into the log file specified in StartLog

Close =

The file (with full path) of the log file for  the event of an application crash. If the application does not crash the log file is not written. Close can also be used without  a value

Example Script

# This is a comment
Variable=PATH=C:\My Files
Import=%PATH%\test1.ifc
Merge=%PATH%\location_prisms.ifc|MERGE_TYPE=READLOCATIONPRISMS
Run=Split Geometries|SPLIT_TYPE=ALL|SMART_SPLIT=OFF
Save=%PATH%\test1.cube
StartLog=%PATH%\test1_out1.log
Apply=%PATH%\test1.xlsx
Run=Basic Quantities
SaveLog Export=%PATH%\test1_out1.ifc
Open=%PATH%\test1.cube
StartLog=%PATH%\test1_out2.log
Apply=%PATH%\test2.xlsx
Apply=%PATH%\test3.xlsx
SaveLog
Export=%PATH%\test1_out2.ifc
Delete=%PATH%\test1.cube
Close = %PATH%\test1_fail.log/p>

 

The example script above does the following.