DesignSeries00010.pngData mapping examples

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: ([Object.Length] * ([Object.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([Record.Cabinet Calculations.Adjacent to Wall], 0.6 * [Record.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.

data_mapping_2.png 

IFC entity condition for a framing member object

Formula:

IF(([Object.structuralUse*] = 'Joist') | ([Object.structuralUse*] = 'Beam'), 'IfcBeam', 'IfcMember')

Result:

If the framing member object’s Structural Use setting is Joist or Beam, the IFC entity will be IfcBeam; otherwise it will be IfcMember.

IFC_condition_ex1.png 

Pset condition for a slab object

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 

Mandatory and default value examples

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];

Examples combining fields and constants

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.

oip_EscalatorEx.png 

Formula:

'Escalator: ' + [Object.Type] + ' Width: ' + [Object.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 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.

oip_Window_ex.png 

Formula:

[Object.VW_Name] ELSE [Object.IDPrefix] + [Object.IDLabel] + [Object.IDSuffix] ELSE 'Window'

Result with no Vectorworks name:

W-01A1

Example using conditions and 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:

[Object.OverallHeight] + IF([Object.IncludeSill] & ([Object.SillStyle] != 'Brick'),[Object.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

Example mapping data sources using selectors

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.

DataManager00013.png 

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'

Example working with symbols and custom geometry

Symbols and custom geometry must have IFC data attached 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 

When we select the IFC Data command and select IfcColumn, we can see how our new mapping works:

oip_symbol_1.png 

For symbols, besides using mapping for their IFC designation, another option can be used to specify data mapping—using the name of the symbol definition. In Data Manager, we can 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 and the data that will be exported by opening the IFC Data dialog box and clicking OK after verifying the suggested IfcFurnishingElement.

oip_symbol_5.png 

 

~~~~~~~~~~~~~~~~~~~~~~~~~

Data mapping expressions

Creating or editing mapping formulas

Using the Data Manager

 

 

 

Was this page helpful?