The acadTexts that are created are attached by the program to an object data table. The program runs perfect on both AutoDesk Map 2004 and AutoDesk Map 2005.
Quite recently though I was asked to make it run on a new machine which has neither AutoDesk Map 2004 nor AutoDesk Map 2005. The only thing that is in that machine is AutoDesk Land Desktop 2005.
After testing the program in AutoDesk Land Desktop I ended up with this:
The program ran from start to end without issuing any errors. At first glance it would seem like everything is okay but if you really look at it -- it is not okay.
The reason why it is not okay is that all the entities pumped which normally should be attached to an object data table
now are not attached to any table at all i.e. they all seemed to have lost all their object data despite the fact that the program did not give any warning of any error.
My boss argues that what runs in AutoDesk Map 2004 and AutoDesk Map 2005 should run as well in AutoDesk Land Desktop as Land Desktop is "sitting on AutoDesk Map and AutoCAD". I know that what he is saying is true -- but in terms of nuts and bolt -- what in the world is happening -- does anyone know how I can tweak my code so that it will work with both AutoDesk Map and Land Desktop ?
Has anybody seen this problem before? Please guide me in anyway you can.
Thank you so much for all the kind help you can give.
Matt
Maybe someone else, who know exactly whether Cad Land Desktop contains Acad
Map object data components or not, could give a straight Yes/No answer,
hopefully.
"matt_1ca" <nos...@address.withheld> wrote in message
news:6184877.111240096...@jiveforum1.autodesk.com...
"matt_1ca" <nos...@address.withheld> wrote in message
news:6184877.111240096...@jiveforum1.autodesk.com...
--
Jeff
check out www.cadvault.com
"Norman Yuan" <Not...@NotReal.not> wrote in message
news:424edafe$1_2@newsprd01...
Thanks for your answer.
> if you use early bound. Does Acad Land Desktop comes
>with those Acad Map components?
The very first program version of the Map 2005/2004 compatible program that I built crashed everytime I ran it in Land Desktop 2005. It crashed right at the very start when my program tries to link to the drawing and so did not really do anything.
'---- Start of old connection code ----------
On Error Resume Next
Err.Clear
Set acadApp = GetObject(, "AutoCAD.Application")
If Err Then 'need to create object
Set acadApp = CreateObject("AutoCAD.Application")
End If
acadApp.Visible = True
Set ThisDrawing = acadApp.ActiveDocument
acadApp.WindowState = acMax
ThisDrawing.WindowState = acMax
Set amP = ThisDrawing.Application.GetInterfaceObject("autocadmap.application.2")
End If
'------ End old connection code
The error that is generated when I run my Exe is something like application ~ failed . So I tried to use late binding for the AutocadMap connection portion(s) and when I did all of a sudden the program run from start to finish without issuing any error at all.
The way I have revised the old connection so that it got rid of crashing is as shown below:
On Error Resume Next
Err.Clear
Set acadApp = GetObject(, "AutoCAD.Application")
If Err Then 'need to create object
Set acadApp = CreateObject("AutoCAD.Application")
End If
acadApp.Visible = True
Set ThisDrawing = acadApp.ActiveDocument
acadApp.WindowState = acMax
ThisDrawing.WindowState = acMax
Err.Clear
Set amP = ThisDrawing.Application.GetInterfaceObject("autocadmap.application.2")
If Err Then 'the version of autocadmap is not 2004
Set amP = ThisDrawing.Application.GetInterfaceObject("autocadmap.application.3")
End If
At first when you are running said program in Land Desktop you would be tempted to be happy seeing that the program now runs about 2 to 3 times faster than it does in Map 2004/2005 -- it turns out though that the reason is because it does not attach any object data to the created text at all.
And so is really a reason to be sad.
As would be the typical flow for this type of program steps are:
1. Create the odtable to hold data if it does not exist yet
2. Pump and name acadtext into the drawing
3. Use AttachTo method on created acadtext in step 2 to
attach said text in the odtable
Looks like the program executes without any problems only step 2 in the above pseudocode, thus the increased execution speed and fails but does not report anything for step 1 and 3.
Matt
I realized this when I found out that all the machines where my program runs either has both AutoCAD Map 2004 and AutoCAD Map 2005 or just AutoCAD Map 2004.
Today, the company bought 3 additional new machines, installed AutoCAD Map 2005 in them (i.e no AutoCAD Map 2004) and when I run the program in those new machines the program fails like it does for AutoCAD LandDesktop 2005 i.e. the program does not attach data to the acadtexts for those three new machines.
To me it is starting to look like a versioning issue and I would appreciate very much ideas you might have in this regard.
Matt