This sample demonstrates how to implement Revit exporter that supports IFC export options of Autodesk Revit IFC
- APS Account: Learn how to create a APS Account, activate subscription and create an app at this tutorial.
- Visual Studio 2019 and later (Windows).
- Revit 2021 and later: required to compile changes into the plugin
{
"id": "RevitIfcExportorActivity",
"commandLine": [
"$(engine.path)\\\\revitcoreconsole.exe /i \"$(args[inputFile].path)\" /al \"$(appbundles[RevitIfcExportor].path)\""
],
"parameters": {
"inputFile": {
"verb": "get",
"description": "Input Revit File",
"required": true,
"localName": "$(inputFile)"
},
"userPropertySetsFile": {
"verb": "get",
"description": "IFC user defined property set definition file",
"localName": "userDefinedParameterSets.txt"
},
"userParameterMappingFile": {
"verb": "get",
"description": "IFC user defined parameter mapping file",
"localName": "userDefinedParameterMapping.txt"
},
"inputJson": {
"verb": "get",
"description": "input Json parameters",
"localName": "params.json"
},
"outputIFC": {
"zip": true,
"verb": "put",
"description": "Exported IFC files",
"localName": "ifc"
}
},
"engine": "Autodesk.Revit+2022",
"appbundles": [
"Autodesk.RevitIfcExportor+dev"
],
"description": "Activity of Revit IFC Exporter with Autodesk IFC export options support"
}
Use userPropertySets filename defined in the IFC export configuration sets and specify addin settings via inline json
{
"activityId": "Autodesk.RevitIfcExportorActivity+dev",
"arguments": {
"inputFile": {
"verb": "get",
"url": "https://developer.api.autodesk.com/oss/v2/apptestbucket/9d3be632-a4fc-457d-bc5d-9e75cefc54b7?region=US"
},
"userPropertySetsFile": {
"verb": "get",
"url": "https://developer.api.autodesk.com/oss/v2/apptestbucket/97095bbc-1ce3-469f-99ba-0157bbcab73b?region=US"
},
"inputJson": {
"url": "data:application/json,{\"exportSettingName\":\"IFC2x3 Coordination View 2.0\"}"
},
"outputIFC": {
"verb": "put",
"url": "https://developer.api.autodesk.com/oss/v2/apptestbucket/9d3be632-a4fc-457d-bc5d-9e75cefc54b7?region=US",
"headers": {
"Content-Type": "application/octet-stream"
}
}
}
}
Note. While providing inuptJSON by inline format, DA will save it as param.json
after DA starts processing the workitem.
Use userPropertySets and userDefinedParameterMapping filename defined in the IFC export configuration sets, and specify addin settings via concrete JSON file
{
"activityId": "Autodesk.RevitIfcExportorActivity+dev",
"arguments": {
"inputFile": {
"verb": "get",
"url": "https://developer.api.autodesk.com/oss/v2/apptestbucket/9d3be632-a4fc-457d-bc5d-9e75cefc54b7?region=US"
},
"userPropertySetsFile": {
"verb": "get",
"url": "https://developer.api.autodesk.com/oss/v2/apptestbucket/97095bbc-1ce3-469f-99ba-0157bbcab73b?region=US"
},
"userParameterMappingFile": {
"verb": "get",
"url": "https://developer.api.autodesk.com/oss/v2/apptestbucket/f0ff99e0-75dc-4aa1-acd4-3933657013d6?region=US"
},
"inputJson": {
"verb": "get",
"url": "https://developer.api.autodesk.com/oss/v2/apptestbucket/ab593357-6c6e-44dc-8308-8a7c92b25494?region=US"
},
"outputIFC": {
"verb": "put",
"url": "https://developer.api.autodesk.com/oss/v2/apptestbucket/9d3be632-a4fc-457d-bc5d-9e75cefc54b7?region=US",
"headers": {
"Content-Type": "application/octet-stream"
}
}
}
}
{
"activityId": "Autodesk.RevitIfcExportorActivity+dev",
"arguments": {
"inputFile": {
"verb": "get",
"url": "https://developer.api.autodesk.com/oss/v2/apptestbucket/9d3be632-a4fc-457d-bc5d-9e75cefc54b7?region=US"
},
"userPropertySetsFile": {
"verb": "get",
"url": "https://developer.api.autodesk.com/oss/v2/apptestbucket/97095bbc-1ce3-469f-99ba-0157bbcab73b?region=US",
"localName": "FmUserDefinedPropSets.txt"
},
"inputJson": {
"url": "data:application/json,{\"exportSettingName\":\"My IFC Export Setup\", \"userDefinedPropertySetsFilenameOverride\": \"FmUserDefinedPropSets.txt\"}"
},
"outputIFC": {
"verb": "put",
"url": "https://developer.api.autodesk.com/oss/v2/apptestbucket/9d3be632-a4fc-457d-bc5d-9e75cefc54b7?region=US",
"headers": {
"Content-Type": "application/octet-stream"
}
}
}
}
{
"activityId": "Autodesk.RevitIfcExportorActivity+dev",
"arguments": {
"inputFile": {
"verb": "get",
"url": "https://developer.api.autodesk.com/oss/v2/apptestbucket/9d3be632-a4fc-457d-bc5d-9e75cefc54b7?region=US"
},
"inputJson": {
"url": "data:application/json,{\"exportSettingName\":\"My IFC Export Setup\", \"viewId\": \"44745acb-ebea-4fb9-a091-88d28bd746c7-000ea86d\"}"
},
"outputIFC": {
"verb": "put",
"url": "https://developer.api.autodesk.com/oss/v2/apptestbucket/9d3be632-a4fc-457d-bc5d-9e75cefc54b7?region=US",
"headers": {
"Content-Type": "application/octet-stream"
}
}
}
}
What if the IFC expected setup hasn't checked the "Export only elements visible in view"
option? No worry, we just need to specify "onlyExportVisibleElementsInView": true
in the inputJson
like below to turn it on on the fly.
{
"activityId": "Autodesk.RevitIfcExportorActivity+dev",
"arguments": {
"inputFile": {
"verb": "get",
"url": "https://developer.api.autodesk.com/oss/v2/apptestbucket/9d3be632-a4fc-457d-bc5d-9e75cefc54b7?region=US"
},
"inputJson": {
"url": "data:application/json,{\"exportSettingName\":\"My IFC Export Setup\", \"viewId\": \"44745acb-ebea-4fb9-a091-88d28bd746c7-000ea86d\", \"onlyExportVisibleElementsInView\": \"true\"}"
},
"outputIFC": {
"verb": "put",
"url": "https://developer.api.autodesk.com/oss/v2/apptestbucket/9d3be632-a4fc-457d-bc5d-9e75cefc54b7?region=US",
"headers": {
"Content-Type": "application/octet-stream"
}
}
}
}
Here is an example of the available options in the params.json. Only exportSettingName
is required.
{
"exportSettingName": "My IFC Export Setup",
"userDefinedPropertySetsFilenameOverride": "DasUserDefinedPropSets.txt",
"userDefinedParameterMappingFilenameOverride": "DasUserDefinedParameterMapping.txt",
"onlyExportVisibleElementsInView": true,
"viewId": "44745acb-ebea-4fb9-a091-88d28bd746c7-000ea86d"
}
#
# User Defined PropertySet Definition File
#
# Format:
# PropertySet: <Pset Name> I[nstance]/T[ype] <element list separated by ','>
# <Property Name 1> <Data type> <[opt] Revit parameter name, if different from IFC>
# <Property Name 2> <Data type> <[opt] Revit parameter name, if different from IFC>
# ...
#
# Data types supported: Area, Boolean, ClassificationReference, ColorTemperature, Count, Currency,
# ElectricalCurrent, ElectricalEfficacy, ElectricalVoltage, Force, Frequency, Identifier,
# Illuminance, Integer, Label, Length, Logical, LuminousFlux, LuminousIntensity,
# NormalisedRatio, PlaneAngle, PositiveLength, PositivePlaneAngle, PositiveRatio, Power,
# Pressure, Ratio, Real, Text, ThermalTransmittance, ThermodynamicTemperature, Volume,
# VolumetricFlowRate
#
# Example property set definition for COBie:
#
#PropertySet: COBie_Specification T IfcElementType
# NominalLength Real COBie.Type.NominalLength
# NominalWidth Real COBie.Type.NominalWidth
# NominalHeight Real COBie.Type.NominalHeight
# Shape Text COBie.Type.Shape
# Size Text COBie.Type.Size
# Color Text COBie.Type.Color
# Finish Text COBie.Type.Finish
# Grade Text COBie.Type.Grade
# Material Text COBie.Type.Material
# Constituents Text COBie.Type.Constituents
# Features Text Cobie.Type.Features
# AccessibilityPerformance Text COBie.Type.AccessibilityPerformance
# CodePerformance Text COBie.Type.CodePerformance
# SustainabilityPerformance Text COBie.Type.SustainabilityPerformance
#
PropertySet: DAS Parameters I IfcRoof
FM ID Text
- Add compile options for multiple Revit versions (e.g. From Revit 2021 to Revit 2023)
- Add pre-complied DLLs to repository releases.
- Support specifying IFC export settings on the fly without pre-saved ones in RVT file.
- Support exporting IFC from Revit links
- Support site placement related options
- Support IFCExchangeRequirements
- Support exporting only elements visible in specified view
This sample is licensed under the terms of the MIT License. Please see the LICENSE file for full details.
Eason Kang @yiskang, Autodesk Developer Advocacy and Support