DesignSeries00276.pngData mapping examples

Mandatory and default values

File exchange scenarios often have requirements that certain data fields must not be empty, or that every data field must have a default value. To ensure that a mandatory data field always contains a value, include a constant at the end of the data mapping formula.

Formulas:

=FIRSTNONEMPTY(Style.'Function', 'NOTDEFINED')

=FIRSTNONEMPTY(OBJECTDATA('General Name'), Style.'Name', 'Roof')

If default values are required for all data fields, but you require specific values for some objects, create a record format, and set a default value for the field that will be the data source. Then attach that record only to the objects that will have specific values, so that you can change the default value in the attached record as necessary. Objects that don't have the record attached will get the default value.

Formula:

=FIRSTNONEMPTY('Pricing Details'.'Discount', FORMATFIELD('Pricing Details','Discount'))

Combining fields and constants

You can use data mapping formulas to improve legibility, to add required prefixes or suffixes, or to combine or calculate data 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 improve the legibility.

oip_EscalatorEx.png 

Formula:

=CONCAT('Escalator: ', 'Escalator'.'Type', ' Width: ', 'Escalator'.'Step width')

Result:

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 the ID Prefix, ID Label, and ID Suffix fields. If all of those parameters are empty, we want to use the word “Window” to identify the window.

oip_Window_ex.png 

Formula:

=FIRSTNONEMPTY(OBJECTDATA('General Name'), CONCAT('Window'.'IDPrefix', 'Window'.'IDLabel', 'Window'.'IDSuffix'), 'Window')

Result with no Vectorworks name:

W-01A1

Record format mapping

To automatically attach custom records and data to Vectorworks plug-in objects as they’re added to a drawing, create a record format with the data fields you want, and then map fields to an appropriate constant value, parameter, or style for that object. This makes it easier to use the various Vectorworks features that report object data, such as worksheets, data tags, and data visualizations.

In this example, the “Cabinet Calculations” record format has been created and added as a data set for the Base Cabinet plug-in object.

data_mapping_1.png 

Countertop Length: Mapped to the cabinet’s Length parameter (the linear measure of the countertop)

Countertop Area: We add a 50 millimeter overhang to the countertop and calculate the area, then divide by 1000 * 1000 to convert the result from square millimeters to square meters (length/depth units are millimeters)

Formula: =('BaseCabinet'.'Length' * ('Base Cabinet'.'Depth' + 50)) / 1000000

Adjacent to Wall: Not mapped; in the Data tab of the Object Info palette, the user defines whether the cabinet is adjacent to a wall, and therefore requires a backsplash

Backsplash Area: If a backsplash is needed, the area is 0.6 meters (the backsplash panel width) * length of the countertop / 1000 (to convert from meters to millimeters). Note that this formula refers to two other fields in the same record.

Formula: =IF(FIRSTNONEMPTY('Cabinet Calculations'.'Adjacent to Wall', FORMATFIELD('Cabinet Calculations', 'Adjacent to Wall')), (0.6*FIRSTNONEMPTY('Cabinet Calculations'.'Countertop Length', FORMATFIELD('Cabinet Calculations', 'Countertop Length'))/1000, 0)

If you delete the record format from the mapping, the record will be detached from all base cabinet instances in the drawing.

When a base cabinet is placed in the drawing, the Data tab of the Object Info palette shows that the record data has been attached automatically. For each mapped field, the By Mapping column controls how the field can be edited.

 

Functions

In this example, we want to calculate the IfcWindow.OverallHeight based on the settings of our window object.

oip_window_ex2.png 

Window_ex3.png 

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 (4) value needs to be added to the window Height.

Formula:

='Window'.'OverallHeight' + IF('Window'.'IncludeSill' & 'Window'.'SillStyle' != 'Brick'), 'Window'.'SillHeight', 0)

Result, when there is no sill, or if the sill type is Brick (adding 0 to the Height value):

2000.0

Result, when there is a sill, and it is not Brick (adding 150.0 to the Height value):

2150.0

Mapping data sources using a selector function

IFC data requires many “enumeration” kinds of data fields, such as 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, using one of the selector functions.

DataManager00279.png 

Formula:

=FIRSTNONEMPTY(IFS('Window'.'SashOperation' = 'Opening', 'FIXEDCASEMENT',
'Window'.'SashOperation' = 'Cased Opening', 'FIXEDCASEMENT',
'Window'.'SashOperation' = 'Fixed Glass', 'FIXEDCASEMENT',
'Window'.'SashOperation' = 'Fixed Glass - No Sash', 'FIXEDCASEMENT',
'Window'.'SashOperation' = 'Single Hung', 'SLIDINGVERTICAL',
'Window'.'SashOperation' = 'Double Hung', 'SLIDINGVERTICAL',
'Window'.'SashOperation' = 'Casement', 'SIDEHUNGLEFTHAND',
'Window'.'SashOperation' = 'Bi-parting Casement', 'SIDEHUNGLEFTHAND',
'Window'.'SashOperation' = 'Horizontal Slider', 'SLIDINGHORIZONTAL',
'Window'.'SashOperation' = 'Awning', 'TOPHUNG',
'Window'.'SashOperation' = 'Hopper', 'BOTTOMHUNG',
'Window'.'SashOperation' = 'Tilt/Turn', 'TILTANDTURNLEFTHAND',
'Window'.'SashOperation' = 'Vertical Pivot', 'PIVOTVERTICAL'), NOTDEFINED')

Conditions

Conditions allow you to handle more complicated cases and to control the IFC data layout more precisely.

Condition to map wall styles to different entities

For example, you might have a file with four wall styles: ExternWall, InteriorWall, Footing, and VirtualWall. In the data mapping for the wall plug-in object, we add two new Primary entities: IfcCovering and IfcFooting. Using the Condition field we set a rule to map the appropriate IFC entity by wall style.

Formula:

=IF(Style.'Name'='ExternWall', 'IfcWallStandardCase', IF(Style.'Name'='InteriorWall', 'IfcCovering', IF(Style.'Name'='Footing', 'IfcFooting', 'No-Export')))

Result:

The exported file will contain walls with one of three IFC entities, depending on the wall style. Walls with the VirtualWall wall style are not mapped to anything, and will not be exported.

Pset condition for a slab object

Formula:

=(FIND('Structural', Style.'Name')=0)

Result:

If the slab object’s Style name starts with “Structural,” the Classification Pset will be attached to the slab.

IFC_condition_ex2.png

Condition to export an object as multiple entities

Conditions can be used when exporting a single object as separate entities. Here we have a wall with multiple components. Using the Function field from the wall style, a different IFC entity can be mapped to each component during export.

Formula:

=IF(OBJECTDATA('Component', 'Function', T=INDEX)='Load-Bearing', 'IfcWallStandardCase', IF(OBJECTDATA('Component', 'Function', T=INDEX)='Inner Finish', 'IfcCovering', IF(OBJECTDATA('Component', 'Function', T=INDEX)='Outer Finish', 'IfcCovering', IF(OBJECTDATA('Component', 'Function', T=INDEX)='OTHER', 'IfcBuildingElementProxy', 'NoExport'))))

Result:

In the IFC file the wall is represented with three different entities: two IfcCoverings, IfcWallStandardCase, and IfcBuildingElementProxy. The component marked with "Air Gap" as its function is not exported.

Because it is possible to have walls with no core component, and the data pane on the Object Info palette only allows for one entity to be visualized, the entity visualized is always the one mapped to the first component. This does not affect the export in this case.

Symbols and custom geometry

Symbols and custom geometry must have IFC data attached or mapped to be exported. Their IFC data mapping is based on the settings of their designated IFC entity type.

In the Data Manager dialog box, we add Pset_ColumnCommon and map the Reference field to the class name of the object. We can also add fixed values TRUE for IsExternal and LoadBearing.

symbol_ex1.png 

We can see the default mapping in the Data tab of the Object Info palette.

oip_symbol_1.png 

For symbols, you can create mappings based on either the symbol's IFC designation or the name of the symbol definition. In Data Manager, we select the symbol definition and then click Add Data Set to define the required IFC data sets that we want to be exported. For example, we add Pset_ManufacturerTypeInformation and then map all the fields to fixed values, since they are the same for all instances of this symbol.

symbol_4.png 

Now, without even attaching IFC data to the symbol definition or to any symbol instances, the symbol is exported as an IfcFurnishingElement with Pset_ManufacturerTypeInformation. We can see the default mapping in the Data tab of the Object Info palette.

oip_symbol_5.png 

Primary and secondary entities

For aggregate objects, primary and secondary entities give you more precision with the IFC data layout. In this example, the curtain wall has IfcCurtainWall as a primary entity set. The secondary entities are IfcMember (frames) and IfcPlate (panels). By turning off, replacing, or completely deleting a secondary entity, you can control the export of the frames and panels.

Data mapping expressions

Creating or editing mapping formulas

Using the Data Manager

 

Was this page helpful?