本文整理匯總了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;
}