.NET

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

how to make GetBoundingBox work in .net?

276 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 (276 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: 343
Registered: ‎12-05-2003
Message 3 of 3 (276 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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

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 to get help installing your software.

Ask the Community