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

geometric extents

3 REPLIES 3
Reply
Message 1 of 4
conard
1791 Views, 3 Replies

geometric extents

I have a dwg file with multiple solid objects and I would like to get the coordinates in order to draw the same objects in another program. I've worked a little with autocad VBA but now I'm working C#. Looking through some help I found online I would like to get the Geometric Extents of these blocks. However, every time I try to run the program it throws a FileNotFound exception before it ever looks at the method. I've referenced the files and I see them in the object browser. It seems as though it will not load the Autodesk.AutoCAD.DatabaseServices namespace. Any help would be greatly appreciated.
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: conard

Show some code if you do need some meaningful help. It is really hard to
guess what is wrong by only knowing you use C#, not VBA. Do you use C# to
automate Acad, or do you use ObjectARX .NET API? Which version of Acad?

Here is one possible reason (I can only guess here):

With .NET API, in Acad2005/6, an Entity has a property, called GeomExtents,
which you can use for the purpose as you described. However, Acad2007 broke
copatibility on this property: it is now called GeometricExtents in
Acad2007. So, if you have code written for Acad2005/6 to access this
property, the code will not run in Acad2007.


wrote in message news:5421826@discussion.autodesk.com...
I have a dwg file with multiple solid objects and I would like to get the
coordinates in order to draw the same objects in another program. I've
worked a little with autocad VBA but now I'm working C#. Looking through
some help I found online I would like to get the Geometric Extents of these
blocks. However, every time I try to run the program it throws a
FileNotFound exception before it ever looks at the method. I've referenced
the files and I see them in the object browser. It seems as though it will
not load the Autodesk.AutoCAD.DatabaseServices namespace. Any help would be
greatly appreciated.
Message 3 of 4
conard
in reply to: conard

The problem I am having appears to be with loading the DatabaseServices namespace. I don't think this is an actual coding problem yet. Right now I'm working in VS2005 and AutoCAD 2006. I don't know the difference between automating using C# or ObjectARX .NET API, and I would use either one if I could get it to work.

VS is telling me that the referenced file is not in the right location(see attached pic). Any method I write including a class from the DatabaseServices namespace will not run, I can't even break inside the method because VS never gets there. As soon as I include

Solid3d ent = (Solid3d)sol;

it will not work correctly.

Right now my references include: acdbmgd, acmgd, AutoCAD, and AXDBLib. The first two from browsing to the AutoCAD 2006 folder and the second two from the COM tab in Add Reference. And I am "using" almost all the possible namespaces.

I want to use the GeometricExtents because it seems to be the only property that will give me the information I need from these solids. If there might be another way please enlighten me. Thanks for your guys help.
Message 4 of 4
Anonymous
in reply to: conard

Again, you have to let us know what you are doing: ObjectARX .NET API or COM
automation.

For .NET API project, you create a .NET DLL by referencing acdbmgd.dll and
acmgd.dll. You load your project inside Acad with "NETLOAD" command. With
.NET API project, you may also reference Acad COM type library and AXDBLib.

With COM automation project (as an EXE app, or as COM DLL used inside Acad
VBA), you do not use acdbmgd.dll and acmgd.dll (unless you want to expose
.NET API component as COM).

So, you may want to tell more about your project or show more code (from
your attachment, I really cannot tell what type of project you are doing,
and guess it look like an Acad automation, since if it is Object ARX .NET
API project, you do not need to create a new AcadApplication object, it is
run inside Acad. If so, you do not have access to/cannot use
DatabaseServices namespace, even you set reference to it in your project).
Until then, really could not help more.

wrote in message news:5422186@discussion.autodesk.com...
The problem I am having appears to be with loading the DatabaseServices
namespace. I don't think this is an actual coding problem yet. Right now
I'm working in VS2005 and AutoCAD 2006. I don't know the difference between
automating using C# or ObjectARX .NET API, and I would use either one if I
could get it to work.

VS is telling me that the referenced file is not in the right location(see
attached pic). Any method I write including a class from the
DatabaseServices namespace
will not run, I can't even break inside the method because VS never gets
there. As soon as I include

Solid3d ent = (Solid3d)sol;

it will not work correctly.

Right now my references include: acdbmgd, acmgd, AutoCAD, and AXDBLib. The
first two from browsing to the AutoCAD 2006 folder and the second two from
the COM tab in Add Reference. And I am "using" almost all the possible
namespaces.

I want to use the GeometricExtents because it seems to be the only property
that wil
l give me the information I need from these solids. If there might be
another way please enlighten me. Thanks for your guys help.

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