AutoCAD Civil 3D Customization

Reply
Contributor
theEntity
Posts: 21
Registered: ‎08-05-2012
Message 1 of 2 (63 Views)

access xref entities objectIDs

63 Views, 1 Replies
10-04-2013 01:49 PM

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

Contributor
theEntity
Posts: 21
Registered: ‎08-05-2012
Message 2 of 2 (59 Views)

Re: access xref entities objectIDs

10-04-2013 02:02 PM in reply to: theEntity

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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Civil 3D Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for AutoCAD Civil 3D helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Civil 3D

Twitter

Facebook

Blogs