.NET

Reply
*perry
Message 1 of 9 (216 Views)

SummaryInfo bug?

216 Views, 8 Replies
10-04-2006 09:31 AM
There seems to be a bug in the .Net implementation of the SummaryInfo
construct. I have a few drawings where some custom info was accidently
entered twice into drawing properties. Autocad itself does'nt seem to
mind this. Attempting to access drawing properties via .Net however
Minds it alot. Net just immediately throws an exception as soon as you
try to create a summaryinfo object so you cant even "correct" the problem.
Heres the first line of the exception:
"Item has already been added. Key in dictionary: 'job no.' Key being
added: 'job no.'
So how am I supposed to work around this? If I get an exception just
replace summaryinfo with a new empty one and rebuilt it? With that
approach you can't even extract the "good" values from the original.

Perry
Distinguished Contributor
Posts: 303
Registered: ‎09-26-2004
Message 2 of 9 (216 Views)

Re: SummaryInfo bug?

10-04-2006 10:20 AM in reply to: *perry
Imho without help of ObjectARX you can not get/put SummaryInfo with duplicate keys in custom info. :smileysad:
*perry
Message 3 of 9 (216 Views)

Re: SummaryInfo bug?

10-04-2006 10:51 AM in reply to: *perry
Alexander Rivilis wrote:
> Imho without help of ObjectARX you can not get/put SummaryInfo with duplicate keys in custom info. :smileysad:
I'm not trying to create duplicate keys, I'm trying to remove
accidentally created duplicates.
*Tony Tanzillo
Message 4 of 9 (216 Views)

Re: SummaryInfo bug?

10-04-2006 11:30 AM in reply to: *perry
Try reading Alex's reply again.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

"perry" wrote in message news:5350536@discussion.autodesk.com...
Alexander Rivilis wrote:
> Imho without help of ObjectARX you can not get/put SummaryInfo with duplicate keys in custom info. :smileysad:
I'm not trying to create duplicate keys, I'm trying to remove
accidentally created duplicates.
*perry
Message 5 of 9 (216 Views)

Re: SummaryInfo bug?

10-04-2006 12:08 PM in reply to: *perry
Tony Tanzillo wrote:
> Try reading Alex's reply again.
>
Yes Tony, I understand that Alex is saying
I could access that object via Arx even if
it contains dupes.
Distinguished Contributor
Posts: 303
Registered: ‎09-26-2004
Message 6 of 9 (216 Views)

Re: SummaryInfo bug?

10-04-2006 01:35 PM in reply to: *perry
Maybe attached code partly help you? :smileyhappy: You can use this function if you get exception with ordinary .NET method Database.SummaryInfo
Best Regards,
Alexander Rivilis.
*perry
Message 7 of 9 (216 Views)

Re: SummaryInfo bug?

10-05-2006 08:25 AM in reply to: *perry
Alexander Rivilis wrote:
> Maybe attached code partly help you? :smileyhappy: You can use this function if you get exception with ordinary .NET method Database.SummaryInfo
> Best Regards,
> Alexander Rivilis.
>
>
> ------------------------------------------------------------------------
Thank you Alexander, that was very helpful indeed. I just slightly
tweaked your code so that it did not add back the arrays of keys/values.
It just deletes them. So in my application, if creating a summary info
object throws an exception I know there is "bad" stuff in the custom
info and I call your routine to delete it, then I rebuild it with my own
data. It works very well now.
I did understand your first post (my reply was not so good though), I
knew this was possible with ARX but not so with .Net. I just am not
knowledgeable in accessing ARX within .Net.
Do you know where I can go to learn more about the acad interop
services? Or do I just have to look at the object browser and hack.
Learn by trial and error?

Thank you again for your help !
Perry
*Alexander Rivilis
Message 8 of 9 (216 Views)

Re: SummaryInfo bug?

10-05-2006 10:15 AM in reply to: *perry
Hi, Perry!

p> I did understand your first post (my reply was not so good though), I
p> knew this was possible with ARX but not so with .Net. I just am not
p> knowledgeable in accessing ARX within .Net.

I try to do that with help of P/Invoke of ObjectARX function but without
success (this function is virtual and not exported from acad.exe of acdb17.dll). :smileysad:
That is why I've found another solution - using ActiveX-model of AutoCAD.

p> Do you know where I can go to learn more about the acad interop
p> services? Or do I just have to look at the object browser and hack.
p> Learn by trial and error?

There are two way that I know:
1) Read AutoCAD 200X Help->ActiveX Automation and VBA->ActiveX and VBA Reference
and translate VBA code to C#.
2) Look at the Object Browser.
Or combine both way - in will be better solution.

p> Thank you again for your help !

:smileyhappy:

Best Regards,
Alexander Rivilis.
*Tony Tanzillo
Message 9 of 9 (216 Views)

Re: SummaryInfo bug?

10-05-2006 10:49 AM in reply to: *perry
Try the VBA/ActiveX programmer's reference.

The code Alex posted uses the AutoCAD ActiveX/COM
interface used by VBA.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

"perry" wrote in message news:5351835@discussion.autodesk.com...
Alexander Rivilis wrote:
> Maybe attached code partly help you? :smileyhappy: You can use this function if you get exception with ordinary .NET method Database.SummaryInfo
> Best Regards,
> Alexander Rivilis.
>
>
> ------------------------------------------------------------------------
Thank you Alexander, that was very helpful indeed. I just slightly
tweaked your code so that it did not add back the arrays of keys/values.
It just deletes them. So in my application, if creating a summary info
object throws an exception I know there is "bad" stuff in the custom
info and I call your routine to delete it, then I rebuild it with my own
data. It works very well now.
I did understand your first post (my reply was not so good though), I
knew this was possible with ARX but not so with .Net. I just am not
knowledgeable in accessing ARX within .Net.
Do you know where I can go to learn more about the acad interop
services? Or do I just have to look at the object browser and hack.
Learn by trial and error?

Thank you again for your help !
Perry

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
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community