.NET

Reply
Contributor
supec
Posts: 19
Registered: ‎11-01-2006
Message 1 of 8 (551 Views)

Block GeometricExtents EXCEPTION

551 Views, 7 Replies
06-19-2007 01:02 PM
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?
*Tony Tanzillo
Message 2 of 8 (551 Views)

Re: Block GeometricExtents EXCEPTION

06-19-2007 03:11 PM 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?
Valued Contributor
pavlos.katsonis
Posts: 67
Registered: ‎09-12-2006
Message 3 of 8 (551 Views)

Re: Block GeometricExtents EXCEPTION

06-19-2007 03:41 PM in reply to: supec
Is the transaction, through which the block was inserted, committed, by the time you call .GeometricExtents?
Contributor
supec
Posts: 19
Registered: ‎11-01-2006
Message 4 of 8 (551 Views)

Re: Block GeometricExtents EXCEPTION

06-19-2007 11:06 PM 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:smileysad: Message was edited by: supec
*Tony Tanzillo
Message 5 of 8 (551 Views)

Re: Block GeometricExtents EXCEPTION

06-20-2007 10:06 AM 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:smileysad:

Message was edited by: supec
Contributor
supec
Posts: 19
Registered: ‎11-01-2006
Message 6 of 8 (551 Views)

Re: Block GeometricExtents EXCEPTION

06-20-2007 10:55 AM 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
*Norman Yuan
Message 7 of 8 (551 Views)

Re: Block GeometricExtents EXCEPTION

06-20-2007 11:43 AM 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?
Contributor
supec
Posts: 19
Registered: ‎11-01-2006
Message 8 of 8 (551 Views)

Re: Block GeometricExtents EXCEPTION

06-20-2007 11:14 PM 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
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 or visit the Installation and Licensing Forum to get help installing your software.