# Filtering Out xRef Objects in Python3 Node

**URL:** <https://forum.dynamobim.com/t/filtering-out-xref-objects-in-python3-node/109612>\
**Category:** Civil 3D\
**Tags:** python\
**Created:** [April 21, 2025, 6:09pm UTC](https://forum.dynamobim.com/t/filtering-out-xref-objects-in-python3-node/109612 "2025-04-21T18:09:40Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![hosneyalaa](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/hosneyalaa/32/100865_2.png) [@hosneyalaa](https://forum.dynamobim.com/u/hosneyalaa)\
**Post date:** [April 22, 2025, 4:10am UTC](https://forum.dynamobim.com/t/filtering-out-xref-objects-in-python3-node/109612/2 "2025-04-22T04:10:02Z")

</div>

CAN YOU SEE THIS CODE

> [@List xrefs loaded in the drawing](https://forum.dynamobim.com/t/list-xrefs-loaded-in-the-drawing/53088/6):
>
> Here one way to do it with python. import clr clr.AddReference('AcMgd') clr.AddReference('AcDbMgd') from Autodesk.AutoCAD.ApplicationServices import \* from Autodesk.AutoCAD.DatabaseServices import \* adoc = Application.DocumentManager.MdiActiveDocument xrefs = [] with adoc.LockDocument(): with adoc.Database as db: with db.TransactionManager.StartTransaction() as t: bt = t.GetObject(db.BlockTableId, OpenMode.ForRead) btr = t.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForRea…

---

_[View the full topic](https://forum.dynamobim.com/t/filtering-out-xref-objects-in-python3-node/109612)._
