/*
I have 2007 and I can't see db.bindxref in my object browser. I did a
search many times on xrefs,bind and
nothing comes up. if you have a link of something that would be very nice.
Also, thanks for your reply.
*/
Strange....
but here is something:
[DllImport("acad.exe", CallingConvention = CallingConvention.Cdecl, CharSet
= CharSet.Unicode,
EntryPoint =
"acedXrefBind@@YAAW4ErrorStatus@Acad@@PB_W_N1PAVAcDbDatabase@@@Z")]
extern public static ErrorStatus acedXrefBind(string XrefBlockname, bool
bInsertBind, bool bQuiet, IntPtr db);
using (Transaction tr =
db.TransactionManager.StartTransaction())
{
BlockReference blkRef = tr.GetObject(id,
OpenMode.ForWrite, false) as BlockReference;
BlockTableRecord blkRec =
(BlockTableRecord)tr.GetObject(blkRef.BlockTableRecord, OpenMode.ForWrite);
if (blkRec.IsFromExternalReference)
{
string blockname = blkRec.Name, fileName =
blkRec.PathName; Point3d origin = blkRec.Origin;
if (acedXrefBind(blockname, true, true,
HostApplicationServices.WorkingDatabase.UnmanagedObject) == ErrorStatus.OK)
ed.WriteMessage("\nXref was binded...");