This is a defect in the References Palette.
Whomever design that feature doesn't understand how complicated modeless
user interfaces are.
Basically, a modeless UI must listen for any changes that would affect the
data that it displays, and that's what the Reference's palette is failing to
do in this case.
One longshot is to try starting the -XREF command (the command line version
with the leading dash), and just exit the command and see if the palette
updates.
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010
http://www.acadxtabs.com
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");
wrote in message news:6255132@discussion.autodesk.com...
Hi all
The code below changes the Xref BlockTableRecord Name within the drawing.
Works well, but I would like to know if there is a way to rename the xref in
the xref palette?
Dim Doc As Document = AcApp.DocumentManager.MdiActiveDocument
Dim Ed As Editor = Doc.Editor
Dim Db As DatabaseServices.Database = Doc.Database
Dim Tr As DatabaseServices.Transaction =
Db.TransactionManager.StartTransaction()
Using
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.LockDocument
Using Tr
Dim DbXrGraph As DatabaseServices.XrefGraph =
Db.GetHostDwgXrefGraph(True)
' look at all Nodes in the XrefGraph. Skip 0 node since it
is the drawing itself.
For i As Integer = 1 To DbXrGraph.NumNodes - 1
Dim XrGraphNode As DatabaseServices.XrefGraphNode =
DbXrGraph.GetXrefNode(i)
If Not XrGraphNode.IsNested Then
Dim btr As DatabaseServices.BlockTableRecord
Try
btr =
DirectCast(Tr.GetObject(XrGraphNode.BlockTableRecordId,
DatabaseServices.OpenMode.ForWrite), DatabaseServices.BlockTableRecord)
Debug.Print(btr.Name)
If btr.Name = StrOldNameThen
btr.Name = StrNewName
Tr.Commit()
Exit For
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End If
Next
End Using
End Using
Any help is appreciated.
Brent