File exchange scenarios frequently include requirements and policies specifying that certain data fields must not be empty, or that every data field needs to have a default value. Only a couple of specific objects have a different value that will be overridden manually. To be certain that a mandatory data field always contains a value, simply include a constant at the end of the data mapping formula.
[Style.Function] ELSE ‘NOTDEFINED’
[Object.VW_Name] ELSE [Style.Name] ELSE ‘Roof’
To handle a case with a default value for most of the objects, but different values for only some specific objects, it is good practice to create a record format, and include a default record field value that becomes the default value of the data source. Then, attach that record only to the objects that will have the specifically different values, and change the value in the attached records as necessary. Objects with no such record attached will get the default value and the objects with that record attached will get the specific value.
[Record.Pricing Details.Discount];
The results of a data mapping formula often need to be “enhanced” to improve legibility, to add a prefix/suffix to meet certain requirements, or to be combined or calculated from multiple sources.
In this example, we need a better description of an escalator, including important information about the manufacturer and the step width. We also want to add some words to increase the legibility.
'Escalator: ' + [Object.Type] + ' Width: ' + [Object.Step width]
Escalator: Otis 510 M Width: 1000 (3' 3")
In another example, we need to set up the name of the window object to come from the Vectorworks name. If there is no Vectorworks name, we want to combine ID Prefix, ID Label, and ID Suffix fields. If all of those parameters are empty, the word “Window” should be used to identify the window.
[Object.VW_Name] ELSE [Object.IDPrefix] + [Object.IDLabel] + [Object.IDSuffix] ELSE 'Window'
W-01A1
In this example, we want to calculate the IfcWindow.OverallHeight based on the settings of our window object.
The Height parameter contains the correct value, as long as the window has no sill or, if it has a sill, it is a Brick Sill type. In any other situation, the Sill Height (3) value needs to be added to the window Height.
[Object.OverallHeight] + IF([Object.IncludeSill] & ([Object.SillStyle] != 'Brick'),[Object.SillHeight], 0)
2000.0
2150.0
IFC data requires many “enumeration” kinds of data fields. Typical examples include: PredefinedType, OperationType, ShapeType, and so on. Sometimes, there is no one-to-one correspondence; the current settings differ from IFC, no valid data sources can be mapped directly, or the values are written in another language.
In this example, we will map the Sash Operation list from the window to the required OperationType of the IFC Window Panel data set.
For the mapping, we will use one of the selector functions, which maps the window Sash Operation list entries to a pair of IFC Window Panel parameters (logical and value):
SELECT2([Object.SashOperation] = 'Opening', 'FIXEDCASEMENT',
[Object.SashOperation] = 'Cased Opening', 'FIXEDCASEMENT',
[Object.SashOperation] = 'Fixed Glass', 'FIXEDCASEMENT',
[Object.SashOperation] = 'Fixed Glass - No Sash', 'FIXEDCASEMENT',
[Object.SashOperation] = 'Single Hung', 'SLIDINGVERTICAL',
[Object.SashOperation] = 'Double Hung', 'SLIDINGVERTICAL',
[Object.SashOperation] = 'Casement', 'SIDEHUNGLEFTHAND',
[Object.SashOperation] = 'Bi-parting Casement', 'SIDEHUNGLEFTHAND',
[Object.SashOperation] = 'Horizontal Slider', 'SLIDINGHORIZONTAL',
[Object.SashOperation] = 'Awning', 'TOPHUNG',
[Object.SashOperation] = 'Hopper', 'BOTTOMHUNG',
[Object.SashOperation] = 'Tilt/Turn', 'TILTANDTURNLEFTHAND',
[Object.SashOperation] = 'Vertical Pivot', 'PIVOTVERTICAL')
ELSE 'NOTDEFINED'
~~~~~~~~~~~~~~~~~~~~~~~~~