本文整理汇总了C#中IFCFile.CreateAxis2Placement3D方法的典型用法代码示例。如果您正苦于以下问题:C# IFCFile.CreateAxis2Placement3D方法的具体用法?C# IFCFile.CreateAxis2Placement3D怎么用?C# IFCFile.CreateAxis2Placement3D使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IFCFile
的用法示例。
在下文中一共展示了IFCFile.CreateAxis2Placement3D方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateAxis
/// <summary>
/// Creates IfcAxis2Placement3D object.
/// </summary>
/// <param name="file">
/// The IFC file.
/// </param>
/// <param name="origin">
/// The origin.
/// </param>
/// <param name="zDirection">
/// The Z direction.
/// </param>
/// <param name="xDirection">
/// The X direction.
/// </param>
/// <returns>
/// The handle.
/// </returns>
public static IFCAnyHandle CreateAxis(IFCFile file, XYZ origin, XYZ zDirection, XYZ xDirection)
{
IFCAnyHandle directionOpt = IFCAnyHandle.Create();
IFCAnyHandle refOpt = IFCAnyHandle.Create();
IFCAnyHandle location = IFCAnyHandle.Create();
if (origin != null)
{
IList<double> measure = new List<double>();
measure.Add(origin.X); measure.Add(origin.Y); measure.Add(origin.Z);
location = CreateCartesianPoint(file, measure);
}
else
{
location = ExporterIFCUtils.GetGlobal3DOriginHandle();
}
bool exportzDirectionAndxDirection = (zDirection != null && xDirection != null && (!MathUtil.IsAlmostEqual(zDirection[2], 1.0) || !MathUtil.IsAlmostEqual(xDirection[0], 1.0)));
if (exportzDirectionAndxDirection)
{
IList<double> axisPts = new List<double>();
axisPts.Add(zDirection.X); axisPts.Add(zDirection.Y); axisPts.Add(zDirection.Z);
directionOpt = CreateDirection(file, axisPts);
}
if (exportzDirectionAndxDirection)
{
IList<double> axisPts = new List<double>();
axisPts.Add(xDirection.X); axisPts.Add(xDirection.Y); axisPts.Add(xDirection.Z);
refOpt = CreateDirection(file, axisPts);
}
return file.CreateAxis2Placement3D(location, directionOpt, refOpt);
}