TheSwamp
Code Red => .NET => Topic started by: nobody on February 24, 2020, 02:24:16 AM
-
I'm using .GetXrefDatabase(false) to iterate through xref, starting a transaction with that database and committing it when I'm done iterating through. Is there anything wrong with this? Generally I try avoiding digging through xrefs if I can.
var xdb = bd.GetXrefDatabase(false);
if (xdb != null)
{
using (Transaction xrt = xdb.TransactionManager.StartTransaction())
{
BlockTableRecord btRecord = (BlockTableRecord)xrt.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(xdb), OpenMode.ForRead);
-
It's been awhile since I looked at .Net, but this looks like you will only change the definition within the current drawing not the actual xref drawing. You would need to get the path to the external drawing, open that and change the information, close and reload the xref. Hope that helps.