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

SummaryInfo bug?

8 REPLIES 8
Reply
Message 1 of 9
Anonymous
420 Views, 8 Replies

SummaryInfo bug?

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
8 REPLIES 8
Message 2 of 9
Anonymous
in reply to: Anonymous

Imho without help of ObjectARX you can not get/put SummaryInfo with duplicate keys in custom info. 😞
Message 3 of 9
Anonymous
in reply to: Anonymous

Alexander Rivilis wrote:
> Imho without help of ObjectARX you can not get/put SummaryInfo with duplicate keys in custom info. 😞
I'm not trying to create duplicate keys, I'm trying to remove
accidentally created duplicates.
Message 4 of 9
Anonymous
in reply to: Anonymous

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. 😞
I'm not trying to create duplicate keys, I'm trying to remove
accidentally created duplicates.
Message 5 of 9
Anonymous
in reply to: Anonymous

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.
Message 6 of 9
Anonymous
in reply to: Anonymous

Maybe attached code partly help you? 🙂 You can use this function if you get exception with ordinary .NET method Database.SummaryInfo
Best Regards,
Alexander Rivilis.
Message 7 of 9
Anonymous
in reply to: Anonymous

Alexander Rivilis wrote:
> Maybe attached code partly help you? 🙂 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
Message 8 of 9
Anonymous
in reply to: Anonymous

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). 😞
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 !

:)

Best Regards,
Alexander Rivilis.
Message 9 of 9
Anonymous
in reply to: Anonymous

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? 🙂 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

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