Access DWG SummaryInfo Custom Properties

Access DWG SummaryInfo Custom Properties

Anonymous
Not applicable
5,886 Views
23 Replies
Message 1 of 24

Access DWG SummaryInfo Custom Properties

Anonymous
Not applicable
Hi

Would really appreciate any help that anybody can give me on this.

I'm trying to programatically access the Custom Properties of a DWG's SummaryInfo, but am constantly coming up against various errors.

From the examples I've found and the other posts I've come across I have to create a new Database object (Autodesk.AutoCAD.DatabaseServices.Database) but when I do I get the following message.

Dim DB as New Database(False, True)

'AccessViolationException was unhandled'
'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'

As you might have guessed I'm new to .NET having done all my previous work in VBA.

Any help will be very much appreciated.

Cheers

G
0 Likes
5,887 Views
23 Replies
Replies (23)
Message 21 of 24

Anonymous
Not applicable
You can read the file properties from the outside
without AutoCAD (via the COM APIs provided by
AutoCAD), but you cannot edit them using those
APIs, or via any means outside of AutoCAD.

I don't have any code examples for the former,
and since its entirely COM/ActiveX based, you
might find more information about it in the VBA
newsgroup.

--
http://www.caddzone.com

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

wrote in message news:5756912@discussion.autodesk.com...
I guess using the ActiveX API is a solution if I want to reach a dwg-file without AutoCAD started. What references should be added for this? And does anyone have any code examples explaining how to read/edit custom dwg file properties that way? I'm trying to solve this using C#, but I'm stuck.
0 Likes
Message 22 of 24

Anonymous
Not applicable
I agree with you that you should be able to access those custom properties outside of AutoCAD. After all, the custom file properties are available to Windows when you right-click the file and choose properties. That doesn't require a .NET dll running inside of AutoCAD to do that so there should be some other basic file header template that allows you to read that information from the file without running AutoCAD. I'm looking for that myself and if I find I I'll post it here.
0 Likes
Message 23 of 24

jan_tappenbeck
Collaborator
Collaborator

hi !

 

this posting is old, but may be interest for my problem.

 

one line of code is

 

Dim Dict As Specialized.StringDictionary = sbuild.CustomProperties

visual Studio 2013 give the message "sbuild.CustomProperties will be outdated.

 

could someone give better code?

 

regards Jan

0 Likes
Message 24 of 24

norman.yuan
Mentor
Mentor

DatabaseSummaryInfoBuilder.CustomProperties has been flagged as "Obsolete" since Acad2009 (or Acad2008, or Acad2010, cannot remember). You should use CustomPropertyTable (which is an IDictionary object) instead. Had you simply looked up the AutoCAD .NET API document, you would have found it out easily.

Norman Yuan

Drive CAD With Code

EESignature

0 Likes