Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Autocad/OpenDWG automation
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Autocad/OpenDWG automation
Divers
Thread ID:
00847451
Message ID:
00847451
Vues:
52
I am having trouble getting an array of Doubles passed correctly to the OpenDWG ActiveX control. Here is the code in VFP8 to add a line of text to an AutoCAD DWG:

*************
dimension insertionPoint(3) as Double

* Define the text object
textString = "Hello, World."
insertionPoint(1) = 6300.000 && x coord
insertionPoint(2) = 7800.000 && y coord
insertionPoint(3) = 0.000 && z coord
height = 60.0

=COMARRAY(odaHost,10) && set array passing to zero-based by reference
= COMARRAY(odaApp,10) && set array passing to zero-based by reference
=COMARRAY(odaDoc,10) && set array passing to zero-based by reference
=COMARRAY(odaDoc.ModelSpace,10) && set array passing to zero-based by reference

* Create the text object in model space
textObj = odaDoc.ModelSpace.AddText(textString, @insertionPoint, height)
*************

Now the above code works without throwing any errors, and the text appears in the DWG (in the wrong place) because AutoCAD always has the x,y,z values shifted so that the result is 0.000,6300.000,7800.000 instead of 6300.000,7800.000,0.000

It appears that COMARRAY is having no effect and still passing a "1" based array to the ActiveX control. Getting desperate, I COMARRAYed every object up the tree, but no luck. I see on the newsgroups others have not fared well with the exact same issue of automating Autocad from VFP.

Any ideas?

Thanks.

-- Paul
Répondre
Fil
Voir

Click here to load this message in the networking platform