I think you may have to use local variables instead of constants when
constructing the array:
   SplineCoords := VarArrayOf([a,b,c, d,e,f, g,h,i]);
not sure if this is simply because a local variable has a specific type (in
which case you could probably just cast each number to it's required type)
or because of some other reason. Thinking about it, you could probably try
just casting each number (may be cleaner to use vars).

Phil.

----- Original Message ----- 
From: "Stephen Barker" <[EMAIL PROTECTED]>
To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
Sent: Sunday, November 02, 2003 6:30 PM
Subject: [DUG]: OLEVariant arrays


> I'm having trouble passing an array into AutoCad - getting one back is not
a
> problem.
>
> code looks like:
>
> var
>   Spline, SplineCoords, StartTangent, EndTangent : OLEVariant;
> begin
>   SplineCoords := VarArrayOf([1,1,0, 5,5,0, 10,0,0]);
>   StartTangent := VarArrayOf([0.5,0.5,0]);
>   EndTangent := VarArrayOf([0.5,0.5,0]);
>
>   Spline := Dwg.ModelSpace.AddSpline(SplineCoords, StartTangent,
> EndTangent);
>
> error on last line says: 'The parameter is incorrect'
>
> I've looked in the System unit, and tried converting the arrays from
Variant
> to Olevariant using code like below but still the same error.
>
>   GetVariantManager(VarMgr);
>   VarMgr.OleVarFromVar(SplineCoords, vSplineCoords);
>   VarMgr.OleVarFromVar(StartTangent, vStartTangent);
>   VarMgr.OleVarFromVar(EndTangent, vEndTangent);
>
> thanks,
> Steve
> --------------------------------------------------------------------------
-
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
> Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
>


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to