本文整理汇总了C#中System.Reference.ConvertToStableRepresentation方法的典型用法代码示例。如果您正苦于以下问题:C# Reference.ConvertToStableRepresentation方法的具体用法?C# Reference.ConvertToStableRepresentation怎么用?C# Reference.ConvertToStableRepresentation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Reference
的用法示例。
在下文中一共展示了Reference.ConvertToStableRepresentation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetInstanceEdgeFromSymbolRef
public static Edge GetInstanceEdgeFromSymbolRef(
Reference symbolRef,
Document dbDoc)
{
Edge instEdge = null;
Options gOptions = new Options();
gOptions.ComputeReferences = true;
gOptions.DetailLevel = ViewDetailLevel.Undefined;
gOptions.IncludeNonVisibleObjects = false;
Element elem = dbDoc.GetElement( symbolRef.ElementId );
string stableRefSymbol = symbolRef
.ConvertToStableRepresentation( dbDoc );
string[] tokenList = stableRefSymbol.Split(
new char[] { ':' } );
string stableRefInst = tokenList[3] + ":"
+ tokenList[4] + ":" + tokenList[5];
GeometryElement geomElem = elem.get_Geometry(
gOptions );
foreach( GeometryObject geomElemObj in geomElem )
{
GeometryInstance geomInst = geomElemObj
as GeometryInstance;
if( geomInst != null )
{
GeometryElement gInstGeom = geomInst
.GetInstanceGeometry();
foreach( GeometryObject gGeomObject
in gInstGeom )
{
Solid solid = gGeomObject as Solid;
if( solid != null )
{
foreach( Edge edge in solid.Edges )
{
string stableRef = edge.Reference
.ConvertToStableRepresentation(
dbDoc );
if( stableRef == stableRefInst )
{
instEdge = edge;
break;
}
}
}
if( instEdge != null )
{
// already found, exit early
break;
}
}
}
if( instEdge != null )
{
// already found, exit early
break;
}
}
return instEdge;
}