.NET

Reply
Distinguished Contributor
wesbird
Posts: 351
Registered: ‎12-05-2003
Message 1 of 3 (294 Views)

how to make GetBoundingBox work in .net?

294 Views, 2 Replies
09-29-2005 09:19 AM
Hi,
this is the my 1st month of AutoCAD and .NET. I tried to make GetBoundingBox work in .net and I find there are no GetBoundingBox. after search around, I got GeomExtents, I put some code in and I got a compile error message:
"AcDbExtents' is inaccessible due to its protection level." What this mean? How should I deal with it?

here is the code:
public static void GetBoundingBox(ObjectId objId, out Point2d bl, out Point2d tr)
{
Database db = HostApplicationServices.WorkingDatabase;
Transaction trans = db.TransactionManager.StartTransaction();
Editor ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;

//
//
Entity ent = (Entity)trans.GetObject(objId,OpenMode.ForRead);
AcDbExtents entExt = ent.GeomExtents;
}


Thank you very much. I really appreciate your help.


Wes
Distinguished Contributor
ChrisArps
Posts: 311
Registered: ‎07-29-2004
Message 2 of 3 (294 Views)

Re: how to make GetBoundingBox work in .net?

09-29-2005 01:34 PM in reply to: wesbird
It means that you cannot access AcDbExtents and you do not need to. It is the underlying wrapper for the dotnet interface to the C++ api.

Right click on the GeomExtents method and choose "Go To Definition". You can also just hover the mouse over the method and wait for the tooltip.

You will see that the type of the property is Extents3d, try that instead.

Chris Arps
Distinguished Contributor
wesbird
Posts: 351
Registered: ‎12-05-2003
Message 3 of 3 (294 Views)

Re: how to make GetBoundingBox work in .net?

09-29-2005 02:19 PM in reply to: wesbird
Thank you. The AutoCAD .Net documentation is terrible.


Wes
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.