Author Topic: Project-Auditing dwgs to a CAD Standard  (Read 19005 times)

0 Members and 1 Guest are viewing this topic.

vegbruiser

  • Guest
Re: Project-Auditing dwgs to a CAD Standard
« Reply #30 on: July 22, 2008, 11:49:49 AM »
@ Glenn R: I just built your sample code, and, although it moves through the items in the listbox with no problem, it throws the following error message to the AutoCAD 2006 editor each time it tries to open a file: -

System Exception: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Disposing of database...

Any ideas? (I'm using AutoCAD 2006 & debugging using VS 2008)  :?

(I've had a similar exception whilst debugging when using the ReadDwgFile and had to resort to opening the files directly)

EDIT: just tried the same code outside of the debugger, and it runs with no problems.  :x

Glenn R

  • Water Moccasin
  • Posts: 1932
  • What idiot child of married cousins wrote this?!
Re: Project-Auditing dwgs to a CAD Standard
« Reply #31 on: July 22, 2008, 11:58:57 AM »
vege,

Had the same here. I believe it's an issue with 2006 and the later Vis Stud 2008. I think from memory, that if you run it with 2007 it will debug ok. I can't test this untill I get home, but somebody else might...

There was also some discussion about ReadWgFile recently on the adesk ng as well if memory serves...
Me

vegbruiser

  • Guest
Re: Project-Auditing dwgs to a CAD Standard
« Reply #32 on: July 22, 2008, 12:05:48 PM »
...There was also some discussion about ReadWgFile recently on the adesk ng as well if memory serves...
Really? I'll go take a look. It's quite annoying if you're trying to debug, as it means you're left with having to open every file rather than just read the database. :|

EDIT: Here's the most relevant post on the subject: http://tinyurl.com/6s5g3g seems it's a problem with a .NET service pack. And as I have no intention of uninstalling/reinstalling .NET 2.x/3.x on multiple machines (that might make use of this code) I think I'm gonna have to use AutoCAD 2009.
« Last Edit: July 22, 2008, 12:11:27 PM by vegbruiser »

Glenn R

  • Water Moccasin
  • Posts: 1932
  • What idiot child of married cousins wrote this?!
Re: Project-Auditing dwgs to a CAD Standard
« Reply #33 on: July 22, 2008, 12:07:42 PM »
WE are using the Express versions as well. Maybe someone with the full monty have a go at it with 2006 if possible...
Me

vegbruiser

  • Guest
Re: Project-Auditing dwgs to a CAD Standard
« Reply #34 on: July 22, 2008, 12:17:14 PM »
WE are using the Express versions as well. Maybe someone with the full monty have a go at it with 2006 if possible...
Sorry, maybe I wasn't clear - I am using the full monty. (I did actually post about this myself a few weeks ago. here and it's clearly a problem that can only be overcome by reverting to an earlier .NET version. :(

Anywho, I can live with not being able to debug the code so long as someone else can do it on a pre .NET 2/3 SP1 setup.

Glenn R

  • Water Moccasin
  • Posts: 1932
  • What idiot child of married cousins wrote this?!
Re: Project-Auditing dwgs to a CAD Standard
« Reply #35 on: July 22, 2008, 02:59:32 PM »
Just tested it with Visual C# 2008 Express, .NET 3.5 and AutoCAD 2007 and debugging in working fine.
Me

Glenn R

  • Water Moccasin
  • Posts: 1932
  • What idiot child of married cousins wrote this?!
Re: Project-Auditing dwgs to a CAD Standard
« Reply #36 on: July 22, 2008, 02:59:56 PM »
Must be a '06 problem...
Me

CmdrDuh

  • Automatic Duh Generator
  • King Gator
  • Posts: 4039
Re: Project-Auditing dwgs to a CAD Standard
« Reply #37 on: July 22, 2008, 03:18:23 PM »
It worked in Autocad 08 using the debugging as well.

On a side note, Glenn, I noticed your user file was stuffed full of info, whilst mine is like 8 lines long.  Is there a necessity for the huge file, and should I edit yours or use mine?
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second

Glenn R

  • Water Moccasin
  • Posts: 1932
  • What idiot child of married cousins wrote this?!
Re: Project-Auditing dwgs to a CAD Standard
« Reply #38 on: July 22, 2008, 03:34:03 PM »
Are you talking about the .csproj.user file or whatever the thing is named Duh? If so, it's a copy from a VS 2005 project that I just dump in to enable debugging in Express.

Can you post yours? The reason I ask, is if I start an Express dll project, the .user file only has a namespace in it - one line....not 8 so I'm curious
Me

CmdrDuh

  • Automatic Duh Generator
  • King Gator
  • Posts: 4039
Re: Project-Auditing dwgs to a CAD Standard
« Reply #39 on: July 22, 2008, 04:03:48 PM »
Like you, I copy this from a previous project and rename it to enable debugging
Quote
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <StartAction>Program</StartAction>
    <StartProgram>C:\Program Files\AutoCAD 2008\acad.exe</StartProgram>
    <StartWorkingDirectory>C:\Program Files\AutoCAD 2008</StartWorkingDirectory>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <StartAction>Program</StartAction>
    <StartProgram>C:\Program Files\AutoCAD 2008\acad.exe</StartProgram>
    <StartWorkingDirectory>C:\Program Files\AutoCAD 2008</StartWorkingDirectory>
  </PropertyGroup>
</Project>
After reading through yours, I think I understand why their are so many lines.  The first group, I didn't know why it was there, the second and third were for if you are set to debug vs. release
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second

CmdrDuh

  • Automatic Duh Generator
  • King Gator
  • Posts: 4039
Re: Project-Auditing dwgs to a CAD Standard
« Reply #40 on: July 22, 2008, 04:05:35 PM »
I cant remember who gave me this file.  It might have been Kerry or MickD, or maybe even TT.
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second

Glenn R

  • Water Moccasin
  • Posts: 1932
  • What idiot child of married cousins wrote this?!
Re: Project-Auditing dwgs to a CAD Standard
« Reply #41 on: July 22, 2008, 04:09:41 PM »
yeah, that's pretty much my thinking as well. You can just take my project in it's entirety and just edit the .user file in your XML editor of choice (I use XML Notepad from Microsoft - quite liking it once you get accustomed to it) and change the AutoCAD paths to suit...which is what I do.

From memory, the first section, amongst other things, sets the 'reference file' locations...ie the location of ac*mgd.dll files....
Me

Glenn R

  • Water Moccasin
  • Posts: 1932
  • What idiot child of married cousins wrote this?!
Re: Project-Auditing dwgs to a CAD Standard
« Reply #42 on: July 22, 2008, 04:16:25 PM »
Duh, have you examined the project code I posted? If so, do you follow it or do you have questions?
Me

CmdrDuh

  • Automatic Duh Generator
  • King Gator
  • Posts: 4039
Re: Project-Auditing dwgs to a CAD Standard
« Reply #43 on: July 22, 2008, 04:23:43 PM »
I did, and I do follow it.  I'm full of questions, I didn't want to start bombarding you yet.  My first question would be how (in theory) are we going to use the DWS files?  I know in theory we are opening them thru ObjectDBX ( i think) and somehow storing the values we want to check against.  Layers for instance, we would create an array maybe, and check layer names against that?  Or is there a better way?    I'm trying to think in 2 separate mindsets, 1 using the DWS, and the other in XML set standards.  Also, are there more plugins to the DWS than Layers, Dims, linetypes and textstyles
« Last Edit: July 22, 2008, 04:27:05 PM by CmdrDuh »
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second

Glenn R

  • Water Moccasin
  • Posts: 1932
  • What idiot child of married cousins wrote this?!
Re: Project-Auditing dwgs to a CAD Standard
« Reply #44 on: July 22, 2008, 04:40:58 PM »
My first question would be how (in theory) are we going to use the DWS files?

Let's walk before we run shall we? :)

I know in theory we are opening them thru ObjectDBX

Forget the term ObjectDBX...it's actually an ARX term used to define the 'separation of concerns' as far as custom objects goes, with respect to the UI component and the dbase component. For example, if I was to create an arx app that defined a custom entity called DuhLine :), the interface would be represented by the .ARX file and the custom DataBase eXtension would be represented by the .DBX file. The DBX file is responsible for persisting the custom object in the dbase and graphical representation amongst other things.

Now before anybody goes off at me, I am simplifying this, but that is the general gist. Having said that, ObjectDBX is a common term amongst VB'ers with respect to the COM library they reference to allow in memory loading and modifications of drawings.

I will not be using the term as far as .NET goes, but what we are doing is opening a drawing in the AutoCAD editor, but not associating a graphical document window with it. Does that make sense?
Me