Author Topic: Acad R2012 from R2006 net.  (Read 4483 times)

0 Members and 1 Guest are viewing this topic.

BillZndl

  • Guest
Acad R2012 from R2006 net.
« on: May 25, 2011, 12:02:22 PM »
Could use some advice.
I've just been told that we are going to AutoCAD 2012 on Windows 7 (64 bit).
The main C# program we are using is compiled from VS2008 exp. (net 2.0) with AutoCAD 2006, WindowsXP ver2002.
NetFramework 4.0 will be on the new machines.

Do I just download VS2010, recompile/debug my existing program (fix all the things that have changed)?
I don't do this kind of work on a regular basis, so am just looking to get kicked in the right direction to get started.

Thanks!








kaefer

  • Guest
Re: Acad R2012 from R2006 net.
« Reply #1 on: May 25, 2011, 01:09:41 PM »
The main C# program we are using is compiled from VS2008 exp. (net 2.0) with AutoCAD 2006, WindowsXP ver2002.

Are you quite sure with that framework version (2.0)?  I'm just looking at acdbmgd.dll (16.2.54.0) and there doesn't seem yet to be any implementation of the System.Collections.IEnumerator interface. Access to any kind of collection is bound to be a bit strange prior to R2007.

Quote
NetFramework 4.0 will be on the new machines.

Not being quite there myself, one can read of certain debugging issues under 2012/4.0. Otherwise 3.5 should be fine too, after adjusting acad.exe.config.

Cheers


BillZndl

  • Guest
Re: Acad R2012 from R2006 net.
« Reply #2 on: May 25, 2011, 01:31:03 PM »
The main C# program we are using is compiled from VS2008 exp. (net 2.0) with AutoCAD 2006, WindowsXP ver2002.

Are you quite sure with that framework version (2.0)?  

Yes, I originally did this in net 3.5 but there was still some users here that had Win2000 so had to go back to 2.0.

Quote
I'm just looking at acdbmgd.dll (16.2.54.0) and there doesn't seem yet to be any implementation of the System.Collections.IEnumerator interface. Access to any kind of collection is bound to be a bit strange prior to R2007.

Thanks, I'll keep an eye out for those.

Quote
NetFramework 4.0 will be on the new machines.

Quote
Not being quite there myself, one can read of certain debugging issues under 2012/4.0. Otherwise 3.5 should be fine too, after adjusting acad.exe.config.

Cheers

Great insight. That should help.

Thanks again!


BillZndl

  • Guest
Re: Acad R2012 from R2006 net.
« Reply #3 on: May 25, 2011, 01:43:26 PM »
Quote
I'm just looking at acdbmgd.dll (16.2.54.0) and there doesn't seem yet to be any implementation of the System.Collections.IEnumerator interface. Access to any kind of collection is bound to be a bit strange prior to R2007.


kaefer,
Can you post a small example of the difference in accessing a collection 2007 and after.

TIA.



RickyD302

  • Newt
  • Posts: 69
Re: Acad R2012 from R2006 net.
« Reply #4 on: May 25, 2011, 02:40:57 PM »
I've taken examples and code from here and compiled using visual 2008 and I've had no problems using on 64bit win 7...but then i've compiled on a 64bit win 7 box.
Growing OLD is mandatory; Growing UP is optional

BillZndl

  • Guest
Re: Acad R2012 from R2006 net.
« Reply #5 on: May 25, 2011, 02:52:43 PM »
I've taken examples and code from here and compiled using visual 2008 and I've had no problems using on 64bit win 7...but then i've compiled on a 64bit win 7 box.
Thanks. I can access a remote computer with win 7 64 bit and autocad 2012 installed.
I already installed VS2010 on my machine but may have to install it on the remote machine instead.
Will know more tommorrow.

kaefer

  • Guest
Re: Acad R2012 from R2006 net.
« Reply #6 on: May 25, 2011, 03:03:55 PM »
Quote
I'm just looking at acdbmgd.dll (16.2.54.0) and there doesn't seem yet to be any implementation of the System.Collections.IEnumerator interface. Access to any kind of collection is bound to be a bit strange prior to R2007.

Can you post a small example of the difference in accessing a collection 2007 and after.

Sorry, I am wrong: AutoCAD R2006 does implement System.Collections.IEnumerator, but not in a type-safe way.

Its Current property always returns System.Object. So that you were responsible to cast it to its proper type when iterationg over it,
either in a foreach loop or when doing fancy stuff with the Enumerator itself. On top of this you weren't able to release the Enumerator's resources when done with it, lacking a Dispose() method.

Minimal example, which I can't test, since 2006's licence expired a long time ago:

Code: [Select]
       [CommandMethod("Foo")]
        public void Foo(){
            Document doc = Application.DocumentManager.MdiActiveDocument;
            Database db = doc.Database;
            Editor ed = doc.Editor;
            using (Transaction tr = db.TransactionManager.StartTransaction()){
                BlockTable bt = (BlockTable)tr.GetObject(db.BlockTableId, OpenMode.ForRead);
                System.Collections.IEnumerator en = bt.GetEnumerator();
                // using((System.IDisposable)en)  // Won't work with 2006
                while (en.MoveNext())
                    ed.WriteMessage("\n{0} ", en.Current.GetType().ToString());
                foreach (var x in bt)
                    ed.WriteMessage("\n{0} ", x.GetType().ToString());
                tr.Commit();
            }
        }

Should print System.Object under 2006, Autodesk.AutoCAD.DatabaseServices.ObjectId later.

Regards

BillZndl

  • Guest
Re: Acad R2012 from R2006 net.
« Reply #7 on: May 26, 2011, 06:42:22 AM »
Okay, thanks kaefer, I see what you mean.
Looks like a long day as I have a lot of catching up to do.
I have to find out if AutoCAD still uses a startup file and what differences there will be if it's a network version.
Stay tuned.  :ugly:

 

BillZndl

  • Guest
Re: Acad R2012 from R2006 net.
« Reply #8 on: May 26, 2011, 11:27:22 AM »
I have VS2010 and Autocad 2012 on the same remote machine.
I open my VS2008 project in VS2010 and have adjusted all the references except I am having troulble
with finding a replacement for AXDBLib and acmgdinternal.
I think acmgdinternal is no longer needed but what about AXDBLib?

TIA

BillZndl

  • Guest
Re: Acad R2012 from R2006 net.
« Reply #9 on: June 03, 2011, 10:18:47 AM »
Can someone help me out with this?
I've replaces all of my references with updated ones.

Quote from: Compiler
The predefined type 'System.Action' is defined in multiple assemblies in the global alias;
using definition from 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll'



BillZndl

  • Guest
Re: Acad R2012 from R2006 net.
« Reply #10 on: June 07, 2011, 09:21:40 AM »
Just a followup.
I've gotten rid of all the errors and my project builds fine.
Still get the warning below and after much research,
haven't found the clear deal for a solution as of yet. 
I'm doing this on a remote computer and I haven't made the security settings on it yet so maybe that's part of the problem.
Still working.....:ugly:

Can someone help me out with this?
I've replaces all of my references with updated ones.

Quote from: Compiler
The predefined type 'System.Action' is defined in multiple assemblies in the global alias;
using definition from 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll'




BillZndl

  • Guest
Re: Acad R2012 from R2006 net.
« Reply #11 on: June 09, 2011, 10:14:14 AM »
Hard to believe but after replacing the acMgd and acDBMgd found in the install directories,
with the ones found in the ObjectARX folders,
this problem went away.

Just a followup.
I've gotten rid of all the errors and my project builds fine.
Still get the warning below and after much research,
haven't found the clear deal for a solution as of yet. 
I'm doing this on a remote computer and I haven't made the security settings on it yet so maybe that's part of the problem.
Still working.....:ugly:

Can someone help me out with this?
I've replaces all of my references with updated ones.

Quote from: Compiler
The predefined type 'System.Action' is defined in multiple assemblies in the global alias;
using definition from 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll'