Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/RvtIO/Ifc/IfcExporter.Ifc4.cs
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,11 @@ int EnsureDirection3D(double x, double y, double z)
newArgs = args + ",.NOTDEFINED.";
break;

case "IFCTRANSPORTELEMENT":
if (a.Length == 11)
newArgs = $"{string.Join(",", a.Take(8))},.NOTDEFINED.";
break;

case "IFCDOORSTYLE":
if (a.Length == 12)
{
Expand Down
7 changes: 5 additions & 2 deletions src/RvtIO/Ifc/IfcExporter.PropertySetsCurrent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public partial class IfcExporter
"Pset_ManufacturerTypeInformation", "Pset_MemberCommon", "Pset_PlateCommon",
"Pset_QuantityTakeOff", "Pset_RailingCommon", "Pset_ReinforcementBarPitchOfBeam",
"Pset_ReinforcementBarPitchOfSlab", "Pset_ReinforcementBarPitchOfWall", "Pset_SlabCommon",
"Pset_StairFlightCommon", "Pset_WallCommon", "Pset_WindowCommon",
"Pset_StairFlightCommon", "Pset_TransportElementCommon", "Pset_WallCommon", "Pset_WindowCommon",
];

/// <summary>The element class lists of Pset_ConcreteElementGeneral that can occur as types.</summary>
Expand All @@ -44,7 +44,7 @@ internal static bool TypeReceivesPropertySetsCurrent(string typeClass, string in
"IFCMEMBERTYPE" => typeElem.CategoryId is CurtainWallMullionCategoryId or StructuralFramingCategoryId,
"IFCBEAMTYPE" or "IFCBUILDINGELEMENTPROXYTYPE" or "IFCCOLUMNTYPE" or "IFCCOVERINGTYPE"
or "IFCCURTAINWALLTYPE" or "IFCDOORSTYLE" or "IFCPLATETYPE" or "IFCRAILINGTYPE"
or "IFCSLABTYPE" or "IFCSTAIRFLIGHTTYPE" or "IFCWALLTYPE" or "IFCWINDOWSTYLE"
or "IFCSLABTYPE" or "IFCSTAIRFLIGHTTYPE" or "IFCTRANSPORTELEMENTTYPE" or "IFCWALLTYPE" or "IFCWINDOWSTYLE"
or "IFCLIGHTFIXTURETYPE" => true,
"IFCDISTRIBUTIONELEMENTTYPE" => instanceIfcType == "IFCFLOWTERMINAL",
_ => false,
Expand Down Expand Up @@ -227,6 +227,9 @@ typeClass is "IFCWINDOWSTYLE" or "IFCDOORSTYLE"
case "IFCSTAIRFLIGHTTYPE":
Add("Pset_StairFlightCommon", 1, Identifier(), NosingLength());
break;
case "IFCTRANSPORTELEMENTTYPE":
Add("Pset_TransportElementCommon", 1, Identifier());
break;
case "IFCWALLTYPE":
Add("Pset_ReinforcementBarPitchOfWall", 1, Label());
Add("Pset_WallCommon", 1, Identifier(), HostThermalTransmittance(), IsExternal("Pset_WallCommon"), FireRating());
Expand Down
2 changes: 1 addition & 1 deletion src/RvtIO/Ifc/IfcExporter.ReferenceCurrent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public partial class IfcExporter
{
"IFCFLOWFITTING" or "IFCFLOWCONTROLLER" or "IFCFLOWTERMINAL" =>
(element.ValidatedDistributionTypeReferenceName, element.ValidatedDistributionTypeReferenceIsBlocked),
"IFCBUILDINGELEMENTPROXY" =>
"IFCBUILDINGELEMENTPROXY" or "IFCTRANSPORTELEMENT" =>
(element.ValidatedProxyTypeReferenceName, element.ValidatedProxyTypeReferenceIsBlocked),
// The element name of a beam can be another name of the instance; the type name of the product name is used, as for the classes above.
"IFCBEAM" => (null, false),
Expand Down
58 changes: 45 additions & 13 deletions src/RvtIO/Ifc/IfcExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1945,6 +1945,8 @@ bool HasCompetingExactHostedWriterAuthority(
? "IFCWALL"
: CurrentProfile && elem.CategoryId == RampCategoryId
? "IFCRAMP"
: CurrentProfile && elem.CategoryId == VerticalCirculationCategoryId
? "IFCTRANSPORTELEMENT"
: MapCategoryToIfcTypeForSchema(elem.CategoryId, _resolvedConfig.Schema)
?? (elem.CategoryId == null && elem.Transform != null && elem.TypeId > 0
? "IFCBUILDINGELEMENTPROXY"
Expand Down Expand Up @@ -4843,6 +4845,8 @@ fallbackSourceOwnerTagId is null
$"{S(productGlobalId)},{R(ownerHistId)},{S(elemName)},$,{S(elemTypeName)},{R(elemPlacementId)},{shapeArg},{S(elem.Id.ToString())},.{ResolveNativeStairShape(elem, referenceElementType, elemById, elementIdOccurrenceCounts, CurrentProfile)}.",
"IFCRAMP" =>
$"{S(productGlobalId)},{R(ownerHistId)},{S(elemName)},$,{S(elemTypeName)},{R(elemPlacementId)},{shapeArg},{S(elem.Id.ToString())},.NOTDEFINED.",
"IFCTRANSPORTELEMENT" =>
$"{S(productGlobalId)},{R(ownerHistId)},{S(elemName)},$,{S(elemTypeName)},{R(elemPlacementId)},{shapeArg},{S(elem.Id.ToString())},$,$,$",
"IFCSTAIRFLIGHT" =>
$"{S(productGlobalId)},{R(ownerHistId)},{S(elemName)},$,{S(elemTypeName)},{R(elemPlacementId)},{shapeArg},{S(elem.Id.ToString())},{(CurrentProfile ? StairFlightAttributes(elem, elemById, stairRuns) : "$,$,$,$")}",
"IFCCOLUMN" or "IFCBEAM" or "IFCMEMBER" or "IFCPLATE"
Expand Down Expand Up @@ -5017,6 +5021,13 @@ fallbackSourceOwnerTagId is null
w, elem, elemEntityId, ownerHistId,
quantityTakeOffReferenceValueId.Value);
}
if (quantityTakeOffReferenceValueId.HasValue
&& ifcType == "IFCTRANSPORTELEMENT")
{
ExportTransportElementCommonPropertySet(
w, elem, elemEntityId, ownerHistId,
quantityTakeOffReferenceValueId.Value);
}
// The current profile has no such description (its sources never create
// Pset_ProvisionForVoid).
if (ifcType == "IFCBUILDINGELEMENTPROXY" && !CurrentProfile
Expand Down Expand Up @@ -7550,7 +7561,7 @@ private int CreateOpeningElement(

// Reused verbatim by Pset_BuildingElementProxyCommon.Reference
// (ExportBuildingElementProxyCommonPropertySet).
if (ifcType == "IFCBUILDINGELEMENTPROXY")
if (ifcType is "IFCBUILDINGELEMENTPROXY" or "IFCTRANSPORTELEMENT")
{
if (element.ValidatedProxyTypeReferenceIsBlocked)
return null;
Expand Down Expand Up @@ -63284,7 +63295,7 @@ private int CreateEmptyShape(StepWriter w, int subCtxId)
or "IFCFLOWCONTROLLER" or "IFCFLOWFITTING" or "IFCFLOWSEGMENT" or "IFCFLOWTERMINAL"
or "IFCFOOTING" or "IFCFURNISHINGELEMENT" or "IFCMEMBER" or "IFCOPENINGELEMENT"
or "IFCPLATE" or "IFCRAILING" or "IFCRAMP" or "IFCRAMPFLIGHT"
or "IFCROOF" or "IFCSLAB" or "IFCSTAIR" or "IFCSTAIRFLIGHT" or "IFCREINFORCINGMESH"
or "IFCROOF" or "IFCSLAB" or "IFCSTAIR" or "IFCSTAIRFLIGHT" or "IFCTRANSPORTELEMENT" or "IFCREINFORCINGMESH"
or "IFCWALL" or "IFCWALLSTANDARDCASE" or "IFCWINDOW" => true,
// IFCSITE, IFCBUILDING, IFCBUILDINGSTOREY, IFCSPACE (IfcSpatialStructureElement),
// IFCDISTRIBUTIONPORT (IfcPort), IFCANNOTATION, IFCGRID - IfcProducts, NOT IfcElements.
Expand Down Expand Up @@ -63491,19 +63502,37 @@ internal static bool ReceivesBuildingElementProxyCommonPropertySet(
return floor.CuttingElementIds?.Contains(elem.Id) != true;
}

private static void ExportCommonReferencePropertySet(
StepWriter w, Element elem, int elemEntityId, int ownerHistId,
int referenceValueId, string propertySetName, string guidSeedPrefix)
{
int psetId = w.Add("IFCPROPERTYSET",
$"{S(IfcGuid.FromName($"{guidSeedPrefix}-pset:{elem.Id}"))},{R(ownerHistId)},{S(propertySetName)},$,{StepWriter.List(R(referenceValueId))}");
w.Add("IFCRELDEFINESBYPROPERTIES",
$"{S(IfcGuid.FromName($"{guidSeedPrefix}-rel:{elem.Id}"))},{R(ownerHistId)},$,$,{StepWriter.List(R(elemEntityId))},{R(psetId)}");
}

/// <summary>
/// Attaches the one-property occurrence-only Pset_BuildingElementProxyCommon to a selected
/// proxy that already emitted QTO.
/// </summary>
private static void ExportBuildingElementProxyCommonPropertySet(
StepWriter w, Element elem, int elemEntityId, int ownerHistId,
int referenceValueId)
{
int psetId = w.Add("IFCPROPERTYSET",
$"{S(IfcGuid.FromName($"building-element-proxy-common-pset:{elem.Id}"))},{R(ownerHistId)},{S("Pset_BuildingElementProxyCommon")},$,{StepWriter.List(R(referenceValueId))}");
w.Add("IFCRELDEFINESBYPROPERTIES",
$"{S(IfcGuid.FromName($"building-element-proxy-common-rel:{elem.Id}"))},{R(ownerHistId)},$,$,{StepWriter.List(R(elemEntityId))},{R(psetId)}");
}
int referenceValueId) =>
ExportCommonReferencePropertySet(
w, elem, elemEntityId, ownerHistId, referenceValueId,
"Pset_BuildingElementProxyCommon", "building-element-proxy-common");

/// <summary>
/// Attaches Pset_TransportElementCommon (Reference) to an IfcTransportElement that already
/// emitted QTO.
/// </summary>
private static void ExportTransportElementCommonPropertySet(
StepWriter w, Element elem, int elemEntityId, int ownerHistId,
int referenceValueId) =>
ExportCommonReferencePropertySet(
w, elem, elemEntityId, ownerHistId, referenceValueId,
"Pset_TransportElementCommon", "transport-element-common");

/// <summary>Dimensions in millimetres; null when the symbol is no box.</summary>
internal static (double Width, double Height, double Depth)? ResolveProvisionForVoidDimensions(
Expand Down Expand Up @@ -64247,7 +64276,7 @@ private static void ExportWallCommonPropertySet(
{
"IFCWALL", "IFCWALLSTANDARDCASE", "IFCCURTAINWALL", "IFCSLAB", "IFCROOF", "IFCFOOTING",
"IFCDOOR", "IFCWINDOW", "IFCBUILDINGELEMENTPROXY", "IFCRAILING", "IFCCOVERING",
"IFCSTAIR", "IFCSTAIRFLIGHT", "IFCRAMP", "IFCCOLUMN", "IFCBEAM", "IFCMEMBER", "IFCPLATE",
"IFCSTAIR", "IFCSTAIRFLIGHT", "IFCRAMP", "IFCTRANSPORTELEMENT", "IFCCOLUMN", "IFCBEAM", "IFCMEMBER", "IFCPLATE",
"IFCFURNISHINGELEMENT", "IFCFLOWSEGMENT", "IFCFLOWTERMINAL", "IFCFLOWFITTING",
"IFCFLOWCONTROLLER", "IFCDISTRIBUTIONFLOWELEMENT", "IFCELECTRICDISTRIBUTIONBOARD",
"IFCOUTLET", "IFCSWITCHINGDEVICE", "IFCSITE", "IFCREINFORCINGMESH",
Expand Down Expand Up @@ -65344,6 +65373,7 @@ private static int GetOrAddPropertySingleValue(
private const int RoofCategoryId = -2000035;
private const int RoofSoffitCategoryId = -2001393;
private const int GutterCategoryId = -2001391;
private const int VerticalCirculationCategoryId = -2001052;
private const int CurtainSystemCategoryId = -2000090;
private const int MassExteriorWallCategoryId = -2003413;
private const int MassInteriorWallCategoryId = -2003412;
Expand Down Expand Up @@ -66712,6 +66742,7 @@ static double NamedDimension(Element e, Element? type, string token)
["IFCCURTAINWALL"] = "IFCCURTAINWALLTYPE",
["IFCBUILDINGELEMENTPROXY"] = "IFCBUILDINGELEMENTPROXYTYPE",
["IFCREINFORCINGMESH"] = "IFCTYPEPRODUCT",
["IFCTRANSPORTELEMENT"] = "IFCTRANSPORTELEMENTTYPE",
["IFCFURNISHINGELEMENT"] = "IFCFURNITURETYPE",
["IFCSTAIRFLIGHT"] = "IFCSTAIRFLIGHTTYPE",
["IFCDOOR"] = "IFCDOORSTYLE",
Expand All @@ -66727,6 +66758,7 @@ static double NamedDimension(Element e, Element? type, string token)
"IFCWALLTYPE", "IFCSLABTYPE", "IFCMEMBERTYPE", "IFCPLATETYPE", "IFCCOLUMNTYPE",
"IFCBEAMTYPE", "IFCCOVERINGTYPE", "IFCRAILINGTYPE", "IFCCURTAINWALLTYPE",
"IFCBUILDINGELEMENTPROXYTYPE", "IFCSTAIRFLIGHTTYPE", "IFCSTAIRTYPE", "IFCRAMPTYPE", "IFCROOFTYPE",
"IFCTRANSPORTELEMENTTYPE",
"IFCLIGHTFIXTURETYPE", "IFCDUCTSEGMENTTYPE", "IFCPIPESEGMENTTYPE", "IFCCABLECARRIERSEGMENTTYPE", "IFCPIPEFITTINGTYPE",
"IFCCABLECARRIERFITTINGTYPE", "IFCVALVETYPE", "IFCDUCTFITTINGTYPE", "IFCAIRTERMINALTYPE",
"IFCELECTRICAPPLIANCETYPE", "IFCFIRESUPPRESSIONTERMINALTYPE",
Expand Down Expand Up @@ -67557,7 +67589,7 @@ private static Dictionary<int, string> WriteTypeObjectsAndRelDefinesByTypeCoreFo
originalSymbolId = ownSymbolId;
}
if ((product.ifcType is "IFCMEMBER" or "IFCPLATE" or "IFCCOLUMN"
or "IFCBUILDINGELEMENTPROXY" or "IFCREINFORCINGMESH" or "IFCFURNISHINGELEMENT"
or "IFCBUILDINGELEMENTPROXY" or "IFCTRANSPORTELEMENT" or "IFCREINFORCINGMESH" or "IFCFURNISHINGELEMENT"
or "IFCFLOWTERMINAL" or "IFCFLOWSEGMENT" or "IFCFLOWFITTING" or "IFCFLOWCONTROLLER"
or "IFCSLAB" or "IFCSTAIRFLIGHT" || currentProfile && product.ifcType == "IFCBEAM")
&& instElem.Geometry?.ExactMappedInstances is { Count: > 0 } mapped
Expand All @@ -67584,7 +67616,7 @@ private static Dictionary<int, string> WriteTypeObjectsAndRelDefinesByTypeCoreFo
}
// A beam, column, and a proxy or furnishing element without a GInstance, is keyed by
// its type element and gets a type of its own when it carries geometry of its own.
if (currentProfile && originalSymbolId == 0 && product.ifcType is "IFCBEAM" or "IFCCOLUMN" or "IFCBUILDINGELEMENTPROXY" or "IFCFURNISHINGELEMENT"
if (currentProfile && originalSymbolId == 0 && product.ifcType is "IFCBEAM" or "IFCCOLUMN" or "IFCBUILDINGELEMENTPROXY" or "IFCFURNISHINGELEMENT" or "IFCTRANSPORTELEMENT"
&& UsesInstanceGeometryOfTypeCurrent(instElem, canonicalType))
ownerId = instElem.Id;
// Each gutter has a type of its own.
Expand Down Expand Up @@ -67990,7 +68022,7 @@ internal static string ResolveProductFamilyAndTypeName(
if (ifcType == "IFCWINDOW" && element.CategoryId == -2000014)
return Own(element.ValidatedWindowTypeReferenceName, element.ValidatedWindowTypeReferenceIsExplicit,
element.ValidatedWindowTypeReferenceIsBlocked);
if (ifcType == "IFCBUILDINGELEMENTPROXY")
if (ifcType is "IFCBUILDINGELEMENTPROXY" or "IFCTRANSPORTELEMENT")
return Own(element.ValidatedProxyTypeReferenceName, element.ValidatedProxyTypeReferenceIsExplicit,
element.ValidatedProxyTypeReferenceIsBlocked);
if ((ifcType == "IFCROOF" && element.CategoryId == -2000035)
Expand Down
Loading
Loading