Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need to pass array of doubles to VBA
Message
 
To
25/02/2002 08:04:23
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00624443
Message ID:
00624575
Views:
15
>To All,
>
>I am attempting to pass an array of doubles to a VBA method in AutoCAD.
>
>The documentation says the array is :
>
>"Variant (three-element array of doubles); input-only
>The 3D WCS coordinates specifying the line start point."
>
>WCS is world coordinate system, the array is a point in space.
>
>I have tried :
>
>*** this does not work
>*** try native array
>local array naPoint1(3) as Double
>local array naPoint2(3) as Double
>naPoint1[1]=62
>naPoint1[2]=420
>naPoint1[3]=0
>naPoint2[1]=432
>naPoint2[2]=430
>naPoint2[1]=0
>
>oLine = oModel.AddLine(@naPoint1,@naPoint2)
>*** or
>oLine = oModel.AddLine(naPoint1,naPoint2)
>
>I downloaded Christof Lange/Mark Wilden ' s Struct class and tried it :
>
>DEFINE CLASS point AS struct
>dimension aPoint(3)
>cMembers = "d:aPoint"
>ENDDEFINE
>
>lnBufSize = 24
>oPoint1 = createobject("point")
>oPoint1.aPoint[1] = 60
>oPoint1.aPoint[2] = 430
>oPoint1.aPoint[3] = 0
>cString1= oPoint1.GetString()
>nPtr1 = oPoint1.GetPointer(lnBufSize)
>oPoint2 = createobject("point")
>oPoint2.aPoint[1] = 630
>oPoint2.aPoint[2] = 430
>oPoint2.aPoint[3] = 0
>cString2= oPoint2.GetString()
>nPtr2 = oPoint2.GetPointer(lnBufSize)
>
>*** try every way of calling the method
>
>oLine = oModel.AddLine(cString1,cString2)
>oLine = oModel.AddLine(@cString1,@cString2)
>oLine = oModel.AddLine(nPtr1,nPtr2)
>oLine = oModel.AddLine(@nPtr1,@nPtr2) && pointer to a pointer!!
>oLine = oModel.AddLine(cString1,cString2)
>oLine = oModel.AddLine(oPoint1.aPoint,oPoint2.aPoint)
>oLine = oModel.AddLine(@oPoint1.aPoint,@oPoint2.aPoint)
>
>Nothing seems to work. All give me an Illegal parameter error.
>
>Methods which return an array of doubles does work. VFP figures out what is going on and returns a correct array of numbers.
>
>Running VFP 7.0 SP1, WIN 2000, ACAD 2002

Don,

I don't know if this will help, but since it hasn't been mentioned, it might be worth a shot. Look at the COMARRAY() function in help. It may be what you need.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform