本文整理汇总了C#中ExporterIFC.GetDoorWindowOpeningHandle方法的典型用法代码示例。如果您正苦于以下问题:C# ExporterIFC.GetDoorWindowOpeningHandle方法的具体用法?C# ExporterIFC.GetDoorWindowOpeningHandle怎么用?C# ExporterIFC.GetDoorWindowOpeningHandle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExporterIFC
的用法示例。
在下文中一共展示了ExporterIFC.GetDoorWindowOpeningHandle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
/// <summary>
/// Creates a creator from DoorWindowInfo.
/// </summary>
/// <param name="exporterIFC">The exporter.</param>
/// <param name="doorWindowInfo">The DoorWindowInfo.</param>
/// <param name="instanceHandle">The instance handle.</param>
/// <param name="levelId">The level id.</param>
/// <returns>The creator.</returns>
public static DoorWindowDelayedOpeningCreator Create(ExporterIFC exporterIFC, DoorWindowInfo doorWindowInfo, IFCAnyHandle instanceHandle, ElementId levelId)
{
if (exporterIFC == null || doorWindowInfo == null)
return null;
DoorWindowDelayedOpeningCreator doorWindowDelayedOpeningCreator = null;
if (doorWindowInfo.HasRealWallHost)
{
Document doc = doorWindowInfo.HostObject.Document;
Wall wall = doorWindowInfo.HostObject as Wall;
FamilyInstance famInst = doorWindowInfo.InsertInstance;
ElementId hostId = wall != null ? wall.Id : ElementId.InvalidElementId;
ElementId instId = famInst != null ? famInst.Id : ElementId.InvalidElementId;
doorWindowDelayedOpeningCreator = new DoorWindowDelayedOpeningCreator();
doorWindowDelayedOpeningCreator.HostId = hostId;
doorWindowDelayedOpeningCreator.InsertId = instId;
doorWindowDelayedOpeningCreator.PosHingeSide = doorWindowInfo.PosHingeSide;
doorWindowDelayedOpeningCreator.DoorWindowHnd = instanceHandle;
doorWindowDelayedOpeningCreator.LevelId = levelId;
doorWindowDelayedOpeningCreator.CreatedFromDoorWindowInfo = true;
WallType wallType = doc.GetElement(wall.GetTypeId()) as WallType;
double unScaledWidth = ((wallType != null) && (wallType.Kind != WallKind.Curtain)) ? wallType.Width : 0.0;
if (!MathUtil.IsAlmostZero(unScaledWidth))
{
IFCAnyHandle openingHnd = exporterIFC.GetDoorWindowOpeningHandle(instId);
if (IFCAnyHandleUtil.IsNullOrHasNoValue(openingHnd))
{
XYZ cutDir = null;
CurveLoop cutLoop = null;
try
{
cutLoop = ExporterIFCUtils.GetInstanceCutoutFromWall(wall.Document, wall, famInst, out cutDir);
}
catch
{
cutLoop = null;
// Couldn't create opening for door in wall - report as error in log when we create log file.
}
if (cutLoop != null)
{
if (doorWindowDelayedOpeningCreator.ExtrusionData == null)
doorWindowDelayedOpeningCreator.ExtrusionData = new List<IFCExtrusionData>();
IFCExtrusionData extrusionData = new IFCExtrusionData();
extrusionData.ExtrusionDirection = cutDir;
extrusionData.ScaledExtrusionLength = UnitUtil.ScaleLength(unScaledWidth);
extrusionData.AddLoop(cutLoop);
doorWindowDelayedOpeningCreator.ScaledHostWidth = UnitUtil.ScaleLength(unScaledWidth);
doorWindowDelayedOpeningCreator.ExtrusionData.Add(extrusionData);
doorWindowDelayedOpeningCreator.HasValidGeometry = true;
}
else
{
// Couldn't create opening for door in wall - report as error in log when we create log file.
}
}
}
}
return doorWindowDelayedOpeningCreator;
}