.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to make GetBoundingBox work in .net?

2 REPLIES 2
Reply
Message 1 of 3
wesbird
528 Views, 2 Replies

how to make GetBoundingBox work in .net?

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
Windows 10 64 bit, AutoCAD (ACA, Map) 2023
2 REPLIES 2
Message 2 of 3
ChrisArps
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
Message 3 of 3
wesbird
in reply to: wesbird

Thank you. The AutoCAD .Net documentation is terrible.


Wes
Windows 10 64 bit, AutoCAD (ACA, Map) 2023

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost