TheSwamp

Code Red => .NET => Topic started by: wannabe on June 06, 2009, 02:41:19 PM

Title: Accesing Attribute Information From DWG Files
Post by: wannabe on June 06, 2009, 02:41:19 PM
Just having a bit of a faff with my first attempt at WPF and decided I'll try and create a little application to automatically create a drawing register, as a Word Document, simply by selecting a list of drawing files.

Using a REGEX I should be able to select any attribute where the name contains "Drawing Title" +/- a couple of letters with punctuation in between.

Anyway, preamble aside, the part of the task I contemplate having the most difficulty is actually accessing the attributes (attributes = autocad attributes defined within a block). I'll need to get at these without opening up a drawing......if that's possible

Are there any swampers experienced or resourceful enough to give me some clues?


Title: Re: Accesing Attribute Information From DWG Files
Post by: sinc on June 06, 2009, 06:35:51 PM
You should be able to create a database and use the ReadDwgFile method to read in the drawing database from the drawing of interest.  From that point on, you should be able to work on that database in much the same way as usual.
Title: Re: Accesing Attribute Information From DWG Files
Post by: wannabe on June 07, 2009, 03:57:02 AM
Thanks.
Title: Re: Accesing Attribute Information From DWG Files
Post by: Bobby C. Jones on June 08, 2009, 08:05:07 AM
Just remember to call .Dispose() on the database after you're finished reading the data from it.
Title: Re: Accesing Attribute Information From DWG Files
Post by: wannabe on June 08, 2009, 09:09:47 AM
Just remember to call .Dispose() on the database after you're finished reading the data from it.

Thanks.

Althoug the application is on  hold at the moment; It's so easy to circumnavigate your intended goals when playing around with WPF.