本文整理汇总了C#中ExporterIFC.RegisterDoorWindowForUncreatedOpening方法的典型用法代码示例。如果您正苦于以下问题:C# ExporterIFC.RegisterDoorWindowForUncreatedOpening方法的具体用法?C# ExporterIFC.RegisterDoorWindowForUncreatedOpening怎么用?C# ExporterIFC.RegisterDoorWindowForUncreatedOpening使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExporterIFC
的用法示例。
在下文中一共展示了ExporterIFC.RegisterDoorWindowForUncreatedOpening方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExportFamilyInstanceAsMappedItem
//.........这里部分代码省略.........
{
exporterIFC.RelateSpatialElement(roomId, instanceHandle);
wrapper.AddElement(instanceHandle, setter, extraParams, false);
}
ExporterIFCUtils.CreateGenericElementPropertySet(exporterIFC, familyInstance, wrapper);
break;
}
case IFCExportType.ExportBuildingElementProxy:
default:
{
bool isBuildingElementProxy = (exportType == IFCExportType.ExportBuildingElementProxy);
if (!isBuildingElementProxy)
{
if (FamilyExporterUtil.IsDistributionControlElementSubType(exportType))
{
IFCLabel controlElementId = IFCLabel.Create();
IFCAnyHandle localPlacementToUse;
ElementId roomId = setter.UpdateRoomRelativeCoordinates(familyInstance, out localPlacementToUse);
instanceHandle = file.CreateDistributionControlElement(instanceGUID,
ownerHistory, instanceName, instanceDescription, instanceObjectType,
localPlacement, rep, instanceElemId, controlElementId);
if (roomId == ElementId.InvalidElementId)
{
wrapper.AddElement(instanceHandle, setter, extraParams, true);
}
else
{
exporterIFC.RelateSpatialElement(roomId, instanceHandle);
wrapper.AddElement(instanceHandle, setter, extraParams, false);
}
OpeningUtil.CreateOpeningsIfNecessary(instanceHandle, familyInstance, extraParams, exporterIFC,
localPlacement, setter, wrapper);
}
else if (!instanceHandle.HasValue)
{
isBuildingElementProxy = true;
}
}
if (isBuildingElementProxy)
{
IFCElementComposition proxyType = IFCElementComposition.Element;
IFCAnyHandle localPlacementToUse;
ElementId roomId = setter.UpdateRoomRelativeCoordinates(familyInstance, out localPlacementToUse);
instanceHandle = file.CreateBuildingElementProxy(instanceGUID,
ownerHistory, instanceName, instanceDescription, instanceObjectType,
localPlacementToUse, rep, instanceElemId, proxyType);
if (roomId == ElementId.InvalidElementId)
{
wrapper.AddElement(instanceHandle, setter, extraParams, true);
}
else
{
exporterIFC.RelateSpatialElement(roomId, instanceHandle);
wrapper.AddElement(instanceHandle, setter, extraParams, false);
}
OpeningUtil.CreateOpeningsIfNecessary(instanceHandle, familyInstance, extraParams, exporterIFC,
localPlacement, setter, wrapper);
}
ExporterIFCUtils.CreateGenericElementPropertySet(exporterIFC, familyInstance, wrapper);
break;
}
}
if (instanceHandle.HasValue)
{
if (doorWindowInfo != null)
{
if (doorWindowInfo.GetOpening().HasValue)
{
IFCLabel relGUID = IFCLabel.CreateGUID();
file.CreateRelFillsElement(relGUID, ownerHistory, IFCLabel.Create(), IFCLabel.Create(), doorWindowInfo.GetOpening(), instanceHandle);
}
else if (doorWindowInfo.NeedsOpening)
{
bool added = doorWindowInfo.SetDelayedFamilyInstance(instanceHandle, localPlacement, doorWindowInfo.AssignedLevelId);
if (added)
exporterIFC.RegisterDoorWindowForOpeningUpdate(doorWindowInfo);
else
{
// we need to fill a later opening.
exporterIFC.RegisterDoorWindowForUncreatedOpening(familyInstance.Id, instanceHandle);
}
}
}
if (typeInfo.GetStyle().HasValue)
exporterIFC.AddTypeRelation(typeInfo.GetStyle(), instanceHandle);
}
}
}
示例2: ExportFamilyInstanceAsMappedItem
//.........这里部分代码省略.........
{
if (FamilyExporterUtil.IsDistributionControlElementSubType(exportType))
{
instanceHandle = IFCInstanceExporter.CreateDistributionControlElement(file, instanceGUID,
ownerHistory, instanceName, instanceDescription, instanceObjectType,
localPlacementToUse, rep, instanceElemId, null);
if (roomId == ElementId.InvalidElementId)
{
wrapper.AddElement(instanceHandle, setter, extraParams, true);
}
else
{
exporterIFC.RelateSpatialElement(roomId, instanceHandle);
wrapper.AddElement(instanceHandle, setter, extraParams, false);
}
}
else if (IFCAnyHandleUtil.IsNullOrHasNoValue(instanceHandle))
{
isBuildingElementProxy = true;
}
}
if (isBuildingElementProxy)
{
Toolkit.IFCElementComposition proxyType = Toolkit.IFCElementComposition.Element;
instanceHandle = IFCInstanceExporter.CreateBuildingElementProxy(file, instanceGUID,
ownerHistory, instanceName, instanceDescription, instanceObjectType,
localPlacementToUse, rep, instanceElemId, proxyType);
if (roomId == ElementId.InvalidElementId)
{
wrapper.AddElement(instanceHandle, setter, extraParams, true);
}
else
{
exporterIFC.RelateSpatialElement(roomId, instanceHandle);
wrapper.AddElement(instanceHandle, setter, extraParams, false);
}
}
IFCAnyHandle placementToUse = localPlacement;
if (!useInstanceGeometry)
{
bool needToCreateOpenings = OpeningUtil.NeedToCreateOpenings(instanceHandle, extraParams);
if (needToCreateOpenings)
{
Transform openingTrf = new Transform(oldTrf);
Transform extraRot = new Transform(oldTrf);
extraRot.Origin = XYZ.Zero;
openingTrf = openingTrf.Multiply(extraRot);
openingTrf = openingTrf.Multiply(typeInfo.StyleTransform);
IFCAnyHandle openingRelativePlacement = ExporterUtil.CreateAxis2Placement3D(file, openingTrf.Origin * scale,
openingTrf.get_Basis(2), openingTrf.get_Basis(0));
IFCAnyHandle openingPlacement = ExporterUtil.CopyLocalPlacement(file, localPlacement);
GeometryUtil.SetRelativePlacement(openingPlacement, openingRelativePlacement);
placementToUse = openingPlacement;
}
}
OpeningUtil.CreateOpeningsIfNecessary(instanceHandle, familyInstance, extraParams, exporterIFC,
placementToUse, setter, wrapper);
PropertyUtil.CreateInternalRevitPropertySets(exporterIFC, familyInstance, wrapper);
break;
}
}
if (!IFCAnyHandleUtil.IsNullOrHasNoValue(instanceHandle))
{
if (doorWindowInfo != null)
{
if (!IFCAnyHandleUtil.IsNullOrHasNoValue(doorWindowInfo.GetOpening()))
{
string relGUID = GUIDUtil.CreateGUID();
IFCInstanceExporter.CreateRelFillsElement(file, relGUID, ownerHistory, null, null, doorWindowInfo.GetOpening(), instanceHandle);
}
else if (doorWindowInfo.NeedsOpening)
{
bool added = doorWindowInfo.SetDelayedFamilyInstance(instanceHandle, localPlacement, doorWindowInfo.AssignedLevelId);
if (added)
exporterIFC.RegisterDoorWindowForOpeningUpdate(doorWindowInfo);
else
{
// we need to fill a later opening.
exporterIFC.RegisterDoorWindowForUncreatedOpening(familyInstance.Id, instanceHandle);
}
}
}
if (!exportParts)
CategoryUtil.CreateMaterialAssociations(doc, exporterIFC, instanceHandle, typeInfo.MaterialIds);
if (!IFCAnyHandleUtil.IsNullOrHasNoValue(typeInfo.Style))
ExporterCacheManager.TypeRelationsCache.Add(typeInfo.Style, instanceHandle);
}
}
}
}
示例3: ExportFamilyInstanceAsMappedItem
//.........这里部分代码省略.........
}
//case IFCExportType.ExportBuildingElementProxy:
//case IFCExportType.ExportBuildingElementProxyType:
default:
{
if (IFCAnyHandleUtil.IsNullOrHasNoValue(instanceHandle))
{
bool isBuildingElementProxy =
((exportType == IFCExportType.ExportBuildingElementProxy) ||
(exportType == IFCExportType.ExportBuildingElementProxyType));
IFCAnyHandle localPlacementToUse = null;
ElementId roomId = setter.UpdateRoomRelativeCoordinates(familyInstance, out localPlacementToUse);
if (!isBuildingElementProxy && FamilyExporterUtil.IsDistributionControlElementSubType(exportType))
{
string ifcelementType = null;
ParameterUtil.GetStringValueFromElement(familyInstance.Id, "IfcElementType", out ifcelementType);
instanceHandle = IFCInstanceExporter.CreateDistributionControlElement(file, instanceGUID,
ownerHistory, instanceName, instanceDescription, instanceObjectType,
localPlacementToUse, repHnd, instanceTag, ifcelementType);
}
else
{
instanceHandle = IFCInstanceExporter.CreateBuildingElementProxy(file, instanceGUID,
ownerHistory, instanceName, instanceDescription, instanceObjectType,
localPlacementToUse, repHnd, instanceTag, null);
}
bool containedInSpace = (roomId != ElementId.InvalidElementId);
bool associateToLevel = containedInSpace ? false : !isChildInContainer;
wrapper.AddElement(familyInstance, instanceHandle, setter, extraParams, associateToLevel);
if (containedInSpace)
exporterIFC.RelateSpatialElement(roomId, instanceHandle);
}
IFCAnyHandle placementToUse = localPlacement;
if (!useInstanceGeometry)
{
bool needToCreateOpenings = OpeningUtil.NeedToCreateOpenings(instanceHandle, extraParams);
if (needToCreateOpenings)
{
Transform openingTrf = new Transform(originalTrf);
Transform extraRot = new Transform(originalTrf);
extraRot.Origin = XYZ.Zero;
openingTrf = openingTrf.Multiply(extraRot);
openingTrf = openingTrf.Multiply(typeInfo.StyleTransform);
XYZ scaledOrigin = openingTrf.Origin * scale;
IFCAnyHandle openingRelativePlacement = ExporterUtil.CreateAxis2Placement3D(file, scaledOrigin,
openingTrf.get_Basis(2), openingTrf.get_Basis(0));
IFCAnyHandle openingPlacement = ExporterUtil.CopyLocalPlacement(file, localPlacement);
GeometryUtil.SetRelativePlacement(openingPlacement, openingRelativePlacement);
placementToUse = openingPlacement;
}
}
OpeningUtil.CreateOpeningsIfNecessary(instanceHandle, familyInstance, extraParams, offsetTransform,
exporterIFC, placementToUse, setter, wrapper);
break;
}
}
if (!IFCAnyHandleUtil.IsNullOrHasNoValue(instanceHandle))
{
ExporterCacheManager.HandleToElementCache.Register(instanceHandle, familyInstance.Id);
if (doorWindowInfo != null)
{
if (!ignoreDoorWindowOpening)
{
if (!IFCAnyHandleUtil.IsNullOrHasNoValue(doorWindowInfo.GetOpening()))
{
string relGUID = GUIDUtil.CreateGUID();
IFCInstanceExporter.CreateRelFillsElement(file, relGUID, ownerHistory, null, null, doorWindowInfo.GetOpening(), instanceHandle);
}
else if (doorWindowInfo.NeedsOpening)
{
bool added = doorWindowInfo.SetDelayedFamilyInstance(instanceHandle, localPlacement, doorWindowInfo.AssignedLevelId);
if (added)
exporterIFC.RegisterDoorWindowForOpeningUpdate(doorWindowInfo);
else
{
// we need to fill a later opening.
exporterIFC.RegisterDoorWindowForUncreatedOpening(familyInstance.Id, instanceHandle);
}
}
}
}
if (!exportParts)
CategoryUtil.CreateMaterialAssociations(exporterIFC, instanceHandle, typeInfo.MaterialIds);
if (!IFCAnyHandleUtil.IsNullOrHasNoValue(typeInfo.Style))
ExporterCacheManager.TypeRelationsCache.Add(typeInfo.Style, instanceHandle);
}
}
}
}
}