本文整理汇总了C#中FamilyInstance.GetOriginalGeometry方法的典型用法代码示例。如果您正苦于以下问题:C# FamilyInstance.GetOriginalGeometry方法的具体用法?C# FamilyInstance.GetOriginalGeometry怎么用?C# FamilyInstance.GetOriginalGeometry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FamilyInstance
的用法示例。
在下文中一共展示了FamilyInstance.GetOriginalGeometry方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CalculateDoorWindowInformation
private void CalculateDoorWindowInformation(ExporterIFC exporterIFC, FamilyInstance famInst,
ElementId overrideLevelId, Transform trf)
{
IFCFile file = exporterIFC.GetFile();
if (ExportingDoor)
{
string doorOperationType = null;
Element doorType = famInst.Document.GetElement(famInst.GetTypeId());
if (doorType != null)
ParameterUtil.GetStringValueFromElement(doorType, BuiltInParameter.DOOR_OPERATION_TYPE, out doorOperationType);
DoorOperationTypeString = "NOTDEFINED";
if (!string.IsNullOrWhiteSpace(doorOperationType))
{
Type enumType = null;
if (ExporterCacheManager.ExportOptionsCache.ExportAs4)
enumType = typeof(Toolkit.IFC4.IFCDoorStyleOperation);
else
enumType = typeof(Toolkit.IFCDoorStyleOperation);
foreach (Enum ifcDoorStyleOperation in Enum.GetValues(enumType))
{
string enumAsString = ifcDoorStyleOperation.ToString();
if (NamingUtil.IsEqualIgnoringCaseSpacesAndUnderscores(enumAsString, doorOperationType))
{
DoorOperationTypeString = enumAsString;
break;
}
}
}
if (DoorOperationTypeString == "NOTDEFINED")
{
// We are going to try to guess the hinge placement.
DoorOperationTypeString = CalculateDoorOperationStyle(famInst);
}
if (FlippedX ^ FlippedY)
DoorOperationTypeString = ReverseDoorStyleOperation(DoorOperationTypeString);
if (String.Compare(DoorOperationTypeString, "USERDEFINED", true) == 0)
{
string userDefinedOperationType;
ParameterUtil.GetStringValueFromElementOrSymbol(doorType, "UserDefinedOperationType", out userDefinedOperationType);
if (!string.IsNullOrEmpty(userDefinedOperationType))
UserDefinedOperationType = userDefinedOperationType;
else
DoorOperationTypeString = "NOTDEFINED"; //re-set to NotDefined if operation type is set to UserDefined but the userDefinedOperationType parameter is empty!
}
}
if (HasRealWallHost)
{
// do hingeside calculation
Wall wall = HostObject as Wall;
PosHingeSide = true;
BoundingBoxXYZ famBBox = null;
Options options = GeometryUtil.GetIFCExportGeometryOptions();
GeometryElement geomElement = famInst.GetOriginalGeometry(options);
if (geomElement != null)
famBBox = geomElement.GetBoundingBox();
if (famBBox != null)
{
XYZ bboxCtr = trf.OfPoint((famBBox.Min + famBBox.Max) / 2.0);
Curve curve = WallExporter.GetWallAxis(wall);
XYZ wallZDir = WallExporter.GetWallHeightDirection(wall);
// famInst.HostParameter will fail if FamilyPlacementType is WorkPlaneBased, regardless of whether or not the reported host is a Wall.
// In this case, just use the start parameter of the curve.
bool hasHostParameter = famInst.Symbol.Family.FamilyPlacementType != FamilyPlacementType.WorkPlaneBased;
double param = hasHostParameter ? famInst.HostParameter : curve.GetEndParameter(0);
Transform wallTrf = curve.ComputeDerivatives(param, false);
XYZ wallOrig = wallTrf.Origin;
XYZ wallXDir = wallTrf.BasisX;
XYZ wallYDir = wallZDir.CrossProduct(wallXDir);
double eps = MathUtil.Eps();
bboxCtr -= wallOrig;
PosHingeSide = (bboxCtr.DotProduct(wallYDir) > -eps);
XYZ famInstYDir = trf.BasisY;
FlippedSymbol = (PosHingeSide != (wallYDir.DotProduct(famInstYDir) > -eps));
}
}
}
示例2: AddObjectsToTree
protected void AddObjectsToTree(FamilyInstance elem, TreeNodeCollection curNodes)
{
Autodesk.Revit.DB.Options geomOp = m_app.Create.NewGeometryOptions();
geomOp.ComputeReferences = false; // Not allowed for GetOriginalGeometry()!
TreeNode tmpNode;
// add geometry with the View set to null.
TreeNode rootNode1 = new TreeNode("View = null");
curNodes.Add(rootNode1);
tmpNode = new TreeNode("Detail Level = Undefined");
geomOp.DetailLevel = ViewDetailLevel.Undefined;
tmpNode.Tag = elem.GetOriginalGeometry(geomOp);
rootNode1.Nodes.Add(tmpNode);
tmpNode = new TreeNode("Detail Level = Coarse");
geomOp.DetailLevel = ViewDetailLevel.Coarse;
tmpNode.Tag = elem.GetOriginalGeometry(geomOp);
rootNode1.Nodes.Add(tmpNode);
tmpNode = new TreeNode("Detail Level = Medium");
geomOp.DetailLevel = ViewDetailLevel.Medium;
tmpNode.Tag = elem.GetOriginalGeometry(geomOp);
rootNode1.Nodes.Add(tmpNode);
tmpNode = new TreeNode("Detail Level = Fine");
geomOp.DetailLevel = ViewDetailLevel.Fine;
tmpNode.Tag = elem.GetOriginalGeometry(geomOp);
rootNode1.Nodes.Add(tmpNode);
// SOFiSTiK FS
// add model geometry including geometry objects not set as Visible.
{
Autodesk.Revit.DB.Options opts = m_app.Create.NewGeometryOptions();
opts.ComputeReferences = false; // Not allowed for GetOriginalGeometry()!;
opts.IncludeNonVisibleObjects = true;
TreeNode rootNode = new TreeNode("View = null - Including geometry objects not set as Visible");
curNodes.Add(rootNode);
tmpNode = new TreeNode("Detail Level = Undefined");
opts.DetailLevel = ViewDetailLevel.Undefined;
tmpNode.Tag = elem.GetOriginalGeometry(opts);
rootNode.Nodes.Add(tmpNode);
tmpNode = new TreeNode("Detail Level = Coarse");
opts.DetailLevel = ViewDetailLevel.Coarse;
tmpNode.Tag = elem.GetOriginalGeometry(opts);
rootNode.Nodes.Add(tmpNode);
tmpNode = new TreeNode("Detail Level = Medium");
opts.DetailLevel = ViewDetailLevel.Medium;
tmpNode.Tag = elem.GetOriginalGeometry(opts);
rootNode.Nodes.Add(tmpNode);
tmpNode = new TreeNode("Detail Level = Fine");
opts.DetailLevel = ViewDetailLevel.Fine;
tmpNode.Tag = elem.GetOriginalGeometry(opts);
rootNode.Nodes.Add(tmpNode);
}
// now add geometry with the View set to the current view
if (elem.Document.ActiveView != null)
{
Options geomOp2 = m_app.Create.NewGeometryOptions();
geomOp2.ComputeReferences = false; // Not allowed for GetOriginalGeometry()!;
geomOp2.View = elem.Document.ActiveView;
TreeNode rootNode2 = new TreeNode("View = Document.ActiveView");
rootNode2.Tag = elem.GetOriginalGeometry(geomOp2);
curNodes.Add(rootNode2);
// SOFiSTiK FS
// add model geometry including geometry objects not set as Visible.
{
Autodesk.Revit.DB.Options opts = m_app.Create.NewGeometryOptions();
opts.ComputeReferences = false; // Not allowed for GetOriginalGeometry()!;
opts.IncludeNonVisibleObjects = true;
opts.View = elem.Document.ActiveView;
TreeNode rootNode = new TreeNode("View = Document.ActiveView - Including geometry objects not set as Visible");
curNodes.Add(rootNode);
rootNode.Tag = elem.GetOriginalGeometry(opts);
}
}
}
示例3: OriginalInstanceGeometry
public OriginalInstanceGeometry(string label, FamilyInstance val, Autodesk.Revit.ApplicationServices.Application app)
: base(label)
{
m_val = val;
m_app = app;
m_hasGeometry = false;
if (m_val != null && m_app != null)
{
Autodesk.Revit.DB.Options geomOp = m_app.Create.NewGeometryOptions();
geomOp.DetailLevel = ViewDetailLevel.Undefined;
if (m_val.GetOriginalGeometry(geomOp) != null)
m_hasGeometry = true;
}
}