.NET

.NET

Reply
Active Member
prakashdotc
Posts: 10
Registered: ‎12-21-2006
Message 1 of 12 (431 Views)

A registered application _APP0 was added to preserve orphaned entity xdata.

431 Views, 11 Replies
12-21-2006 10:02 PM
Hi All,

when i try to drag drop an object which is created through .Net i'm getting this error at command prompt

'A registered application _APP0 was added to preserve orphaned entity xdata.'

any idea to solve this problem, thank's ----------- Prakash.C
*Matt
Message 2 of 12 (431 Views)

Re: A registered application _APP0 was added to preserve orphaned entity xdata.

12-21-2006 10:29 PM in reply to: prakashdotc
Sounds like you adding XData using an applicationname not registred in the
current dwg.

"Application names are saved with the extended data of each entity that uses
them and in the APPID table. An application must register the name or names
it uses."

/Matt


wrote in message news:5433798@discussion.autodesk.com...
Hi All,

when i try to drag drop an object which is created through .Net i'm
getting this error at command prompt

'A registered application _APP0 was added to preserve orphaned entity
xdata.'

any idea to solve this problem, thank's ----------- Prakash.C
Active Member
prakashdotc
Posts: 10
Registered: ‎12-21-2006
Message 3 of 12 (431 Views)

Re: A registered application _APP0 was added to preserve orphaned entity xdata.

12-21-2006 11:27 PM in reply to: prakashdotc
Hi Matt,

thank's for U'r reply, can i know how register application name in the current dwg, can u explain a little bit brief please,
thank u.

- Prakash.C
*Matt
Message 4 of 12 (431 Views)

Re: A registered application _APP0 was added to preserve orphaned entity xdata.

12-22-2006 03:46 AM in reply to: prakashdotc
In ARX you just call acdbRegApp
I guess there something like it in .NET, could be RegAppAcadName..




wrote in message news:5433827@discussion.autodesk.com...
Hi Matt,

thank's for U'r reply, can i know how register application name in
the current dwg, can u explain a little bit brief please,
thank u.

- Prakash.C
Distinguished Contributor
NathTay
Posts: 1,691
Registered: ‎12-15-2003
Message 5 of 12 (431 Views)

Re: A registered application _APP0 was added to preserve orphaned entity xdata.

12-26-2006 02:00 PM in reply to: prakashdotc
See Attached.
Distinguished Contributor
NathTay
Posts: 1,691
Registered: ‎12-15-2003
Message 6 of 12 (431 Views)

Re: A registered application _APP0 was added to preserve orphaned entity xdata.

12-26-2006 02:00 PM in reply to: prakashdotc
Might help if I attached it.
Active Member
prakashdotc
Posts: 10
Registered: ‎12-21-2006
Message 7 of 12 (431 Views)

Re: A registered application _APP0 was added to preserve orphaned entity xdata.

12-27-2006 01:35 AM in reply to: prakashdotc
Thank U Matt, Nathan Taylor for U'r reply. I'm working on the solutions which u provided, i'll come back to u if i have any problem in it.

- Prakash.C
*Tony Tanzillo
Message 8 of 12 (431 Views)

Re: A registered application _APP0 was added to preserve orphaned entity xdata.

12-27-2006 03:32 AM in reply to: prakashdotc
> Private Function GetTableRecordId(ByVal objTableId As ObjectId, ByVal strName As String) As ObjectId

If i may suggest, try to avoid coupling your method to the
current working database or active document's database,
whenever the method takes a database-specific object as a
parameter.

IOW, use the Database property of the table ObjectId
passed as the first parameter instead of the current
working database.

Doing makes the method more generic and usable with
any database.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

wrote in message news:5435500@discussion.autodesk.com...
Might help if I attached it.
Distinguished Contributor
NathTay
Posts: 1,691
Registered: ‎12-15-2003
Message 9 of 12 (431 Views)

Re: A registered application _APP0 was added to preserve orphaned entity xdata.

12-27-2006 01:34 PM in reply to: prakashdotc
Thanks Tony.

So
Dim objDB As Database = HostApplicationServices.WorkingDatabase
Should be
Dim objDB As Database = objTableId.Database

That makes good sense.

Regards - Nathan
Active Member
prakashdotc
Posts: 10
Registered: ‎12-21-2006
Message 10 of 12 (431 Views)

Re: A registered application _APP0 was added to preserve orphaned entity xdata.

12-29-2006 05:21 AM in reply to: prakashdotc
Hi Nathan & Tony,

Thank U very much for U'r reply, Actually i'm creating a tool palette with .Net 2005 for AutoCAD 2007, which will be loaded with various images when i drag drop the with doesn't have any text in it there's no problem at all, but when i drag drop a image which has some text i'm getting this error, here's my code where i'm creating MText with style, please review this and give a solution, please.

Autodesk.AutoCAD.DatabaseServices.MText mText = new Autodesk.AutoCAD.DatabaseServices.MText()
{
mText.Contents = text.emrtext.Text;
mText.TextHeight = Math.Abs(font.elfw.elfLogFont.lfHeight);
mText.Color = textColor;

using (AcadDb.TextStyleTableRecord tstR = new Autodesk.AutoCAD.DatabaseServices.TextStyleTableRecord())
{
tstR.Name = "Style" + fileName + instanceIndex + textStyleCount++;

/// -------- Here is where i have inserted U'r code --------- ///
Autodesk.AutoCAD.DatabaseServices.RegAppTable objRAT;
objRAT = ((Autodesk.AutoCAD.DatabaseServices.RegAppTable)trans.GetObject(db.RegAppTableId, Autodesk.AutoCAD.DatabaseServices.OpenMode.ForWrite, false));
Autodesk.AutoCAD.DatabaseServices.RegAppTableRecord objRATR;
Autodesk.AutoCAD.DatabaseServices.ObjectId objRATRID = new Autodesk.AutoCAD.DatabaseServices.ObjectId();
objRATRID = GetTableRecord(db.RegAppTableId, db, trans, tstR.Name);

if (objRATRID == Autodesk.AutoCAD.DatabaseServices.ObjectId.Null)
{
objRATR = new Autodesk.AutoCAD.DatabaseServices.RegAppTableRecord();
objRATR.Name = tstR.Name;
objRAT.Add(objRATR);
trans.AddNewlyCreatedDBObject(objRATR, true);
}

///---------------------------------------------------///
tstR.Font = new Autodesk.AutoCAD.GraphicsInterface.FontDescriptor((font.FaceName.Equals("System")) ? "Arial" : font.FaceName, font.IsBold, font.IsItalic, font.CharSet, font.PitchAndFamily);

tstR.TextSize = Math.Abs(font.elfw.elfLogFont.lfHeight);
AcadDb.TextStyleTable tst = (AcadDb.TextStyleTable)trans.GetObject(db.TextStyleTableId, AcadDb.OpenMode.ForWrite);
mText.TextStyle = tst.Add(tstR);
trans.AddNewlyCreatedDBObject(tstR, true);
}

mText.TextHeight *= 0.65;

// btr is BlockTableRecord

btr.AppendEntity(mText);
trans.AddNewlyCreatedDBObject(mText, true);
}

thank U & bye - Prakash.C
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 or visit the Installation and Licensing Forum to get help installing your software.