Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

access xref entities objectIDs

1 REPLY 1
Reply
Message 1 of 2
theEntity
258 Views, 1 Reply

access xref entities objectIDs

can someone translate this to vb please?

 

<code>

private static void FindObjectsInXREF(GraphNode root, string layerName, string xrefName, out List<ObjectId> polyObjIds)
{
polyObjIds = new List<ObjectId>();
for (int o = 0; o < root.NumOut; o++)
{
XrefGraphNode child = root.Out(o) as XrefGraphNode;
if (child.XrefStatus == XrefStatus.Resolved && child.Name == xrefName)
{
BlockTableRecord bl = child.BlockTableRecordId.GetObject(OpenMode.ForRead) as BlockTableRecord;
foreach (ObjectId objId in bl)
{
Autodesk.AutoCAD.DatabaseServices.Entity ent = objId.GetObject(OpenMode.ForRead) as Autodesk.AutoCAD.DatabaseServices.Entity;
Type entType = ent.GetType();
if (ent.Layer == xrefName + "|" + layerName && (entType == typeof(Polyline) ||
entType == typeof(Polyline) ||
entType == typeof(Alignment) ||
entType == typeof(Polyline3d) ||
entType == typeof(Polyline2d)))
{
polyObjIds.Add(objId);
}
}
}
}
}

<code>

 

 

i also need to a filterselection on the xref for a certain layer otherwise the program might get slow with large dawings

 

thx in advance

1 REPLY 1
Message 2 of 2
theEntity
in reply to: theEntity

WHat I also really would like help with is copying some of these xref entities into my active database

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report