In one my codes I am using a property of an Editor [ ActiveViewportId ] and I am able to compile that when I reference the (acdbmgd, acmgd) from 2011 without any problems.
When I try to do the same for the 2008, I get an error stating that [ ‘ActiveViewportId’ is not a member of ‘Autodesk.AutoCAD.EditorInput.Editor’ ]
Do we as .net programmers have a remedy for situations like the one above? Can we import objects from one class library to another? I am just trying to find the best way on how someone would go about trying to make their code compatible across several versions of AutoCAD.
Thats a pretty big jump between versions. Later versions frequently include things which are not available in older versions, and there is nothing to be done about it aside from coding based on the most restrictive environment (forward compatibility is always easier). Otherwise, you need to code specifically for the quirks and limitations of each version.
So with .NET one has to “compile their code” overtime a new version of CAD is issued. Because it appears that it’s not only backward incompatible but it’s also forward incompatible too.
I tried running my 2008 code in 2013 and it does not work.
I ask this because files like lisp and vba have been running on multi versions of CAD without any issues, and with .NET it’s less than 5 and the code needs amendments.
So how would one go about keeping track with their .NET code? Procedures, best practices; I would like to learn and adapt good habits. Any advice on this topic would be appreciated.
There're very few forward compatibility issues with the .NET API, except the 2013 "big split".
I have many programs targeting the A2007 SDK (Framework 2.0) which work from A2007 to A2012 without any changes in the code nor need to new compilation, and which only needed a new compilation referencing A2013 assemblies to work with A2013-2014.
By my side, the only forward compatibility problem I encountered before 2013 was with abstract method Drawable.ViewportDraw() which changed to Drawable.SubViewportDraw() with A2010 (see here).