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

Block GeometricExtents EXCEPTION

7 REPLIES 7
Reply
Message 1 of 8
supec
1719 Views, 7 Replies

Block GeometricExtents EXCEPTION

when I try to get Extents of block, which is NONnull CAD throws exception (blocks are mainly one atribute blocks made from text):
System.Reflection.TargetInvocationException: Cíl vyvolání způsobil výjimku. ---> Autodesk.AutoCAD.Runtime.Exception: eNullExtents v Autodesk.AutoCAD.DatabaseServices.Entity.get_GeometricExtents()

It's thrown by this piece of code:
if (entBlockStamp.GeometricExtents.MinPoint.X <= entBlockToFill.GeometricExtents.MinPoint.X & entBlockStamp.GeometricExtents.MaxPoint.X >= entBlockToFill.GeometricExtents.MaxPoint.X & entBlockStamp.GeometricExtents.MinPoint.Y <= entBlockToFill.GeometricExtents.MinPoint.Y & entBlockStamp.GeometricExtents.MaxPoint.Y >= entBlockToFill.GeometricExtents.MaxPoint.Y)

I tried to "solve" it with:
if (entBlockStamp.GeometricExtents!=null & entBlockToFill.GeometricExtents!=null)
but with no result.

Any Ideas?
7 REPLIES 7
Message 2 of 8
Anonymous
in reply to: supec

Does the block contain any entities aside from the
attribute definition?

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5631446@discussion.autodesk.com...
when I try to get Extents of block, which is NONnull CAD throws exception (blocks are mainly one atribute blocks made from text):
System.Reflection.TargetInvocationException: Cíl vyvolání způsobil výjimku. ---> Autodesk.AutoCAD.Runtime.Exception: eNullExtents v Autodesk.AutoCAD.DatabaseServices.Entity.get_GeometricExtents()

It's thrown by this piece of code:
if (entBlockStamp.GeometricExtents.MinPoint.X <= entBlockToFill.GeometricExtents.MinPoint.X & entBlockStamp.GeometricExtents.MaxPoint.X >= entBlockToFill.GeometricExtents.MaxPoint.X & entBlockStamp.GeometricExtents.MinPoint.Y <= entBlockToFill.GeometricExtents.MinPoint.Y & entBlockStamp.GeometricExtents.MaxPoint.Y >= entBlockToFill.GeometricExtents.MaxPoint.Y)

I tried to "solve" it with:
if (entBlockStamp.GeometricExtents!=null & entBlockToFill.GeometricExtents!=null)
but with no result.

Any Ideas?
Message 3 of 8
pavlos.katsonis
in reply to: supec

Is the transaction, through which the block was inserted, committed, by the time you call .GeometricExtents?
Message 4 of 8
supec
in reply to: supec

yes, it is commited (I do this on premade file)
and NO, block has no more entities except of one atribute.

strange thing is, exception seems to be thrown on different blocks, every time program is executed:( Message was edited by: supec
Message 5 of 8
Anonymous
in reply to: supec

You can't use a DBObject once the transaction you
get it from is committed or aborted.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5631838@discussion.autodesk.com...
yes, it is commited (I do this on premade file)
and NO, block has no more entities except of one atribute.

strange thing is, exception seems to be thrown on different blocks, every time program is executed:(

Message was edited by: supec
Message 6 of 8
supec
in reply to: supec

ah, all right, bad explanation of situation from me, sorry.
transaction isn't commited, but blocks are already inserted in the drawing...
You can find whole code in enclosure. I want to find block, which is within extents of stamp (block) and change his atribute according to dataset table. Basicly trasfer of data from *.csv file into dwg, which has already existing blocks and atributes. I do COMMIT transaction after all of atributes are changed.
Thanks
Message 7 of 8
Anonymous
in reply to: supec

Since Entity.GeometricExtents property is the one of incompatible properties
since acad2007 to the older version 2005/6. Could be this problem is caused
by running your app on acad2005/6 (you did not mention the Acad version you
use, so, I just shoot in the dark).


wrote in message news:5631446@discussion.autodesk.com...
when I try to get Extents of block, which is NONnull CAD throws exception
(blocks are mainly one atribute blocks made from text):
System.Reflection.TargetInvocationException: Cíl vyvolání zpusobil
výjimku. ---> Autodesk.AutoCAD.Runtime.Exception: eNullExtents v
Autodesk.AutoCAD.DatabaseServices.Entity.get_GeometricExtents()

It's thrown by this piece of code:
if (entBlockStamp.GeometricExtents.MinPoint.X <=
entBlockToFill.GeometricExtents.MinPoint.X &
entBlockStamp.GeometricExtents.MaxPoint.X >=
entBlockToFill.GeometricExtents.MaxPoint.X &
entBlockStamp.GeometricExtents.MinPoint.Y <=
entBlockToFill.GeometricExtents.MinPoint.Y &
entBlockStamp.GeometricExtents.MaxPoint.Y >=
entBlockToFill.GeometricExtents.MaxPoint.Y)

I tried to "solve" it with:
if (entBlockStamp.GeometricExtents!=null &
entBlockToFill.GeometricExtents!=null)
but with no result.

Any Ideas?
Message 8 of 8
supec
in reply to: supec

AutoCAD is 2007, but file is saved as ACAD 2000, does it matter? Now I do not have time to try to save it as 2007, I'll try it on afternoon.

Sorry, my mistake, I had empty cells in CSV file and that was causing the exception.
Thanks for Your time. Message was edited by: supec

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