/* AutoCAD VBA/LISP-Dokumentation for addCircle: More about VBA-type pecularities: */ parse source . . thisPgm say "Executing this ooRexx program:" thisPgm bUseApp=.true -- set to .false, if no AutoCAD present if bUseApp then do myApp = .oleobject~new("AutoCAD.Application") call SysSleep 5 myApp~visible = .true myDwg = myApp~ActiveDocument say myDwg~name space = myDwg~ModelSpace end radius = 5.2 -- plain Rexx: string (number) arrCenterPoint = .array~of(0,0,0) -- plain Rexx array of strings (numbers) -- bUseApp=.true if bUseApp then call test space, "round 0: plain Rexx values", arrCenterPoint, radius do counter c i=1 to 2 -- Rexx values decRadius=createOleVariant(round, radius,"VT_DECIMAL") -- cast to VT_DECIMAL decArrCenterPoint_a =createOleVariant(round, arrCenterPoint, "VT_DECIMAL,VT_ARRAY") if bUseApp then call test space, "round" i"a) decArrCenterPoint_a -> ", decArrCenterPoint_a, decRadius decArrCenterPoint_b =createOleVariant(round, arrCenterPoint, "VT_ARRAY,VT_DECIMAL") if bUseApp then call test space, "round" i"b) decArrCenterPoint_b -> ", decArrCenterPoint_b, decRadius -- casted values dec0=createOleVariant(round, 0,"VT_DECIMAL") -- 0 explicitly typed as a decimal arrCenterPointDec0 =.array~of(dec0,dec0,dec0) -- Rexx array of VT_DECIMAL decArrCenterPointDec0_a =createOleVariant(round, arrCenterPointDec0, "VT_DECIMAL,VT_ARRAY", "IN") if bUseApp then call test space, "round" i"c) decArrCenterPointDec0_a -> ", decArrCenterPointDec0_a, decRadius decArrCenterPointDec0_b =createOleVariant(round, arrCenterPointDec0, "VT_ARRAY,VT_DECIMAL", "IN") if bUseApp then call test space, "round" i"d) decArrCenterPointDec0_b -> ", decArrCenterPointDec0_b, decRadius end ::routine createOleVariant use arg round, value, vt_types if round=1 then return .oleVariant~new(value, vt_types) -- explicitly denote IN argument return .oleVariant~new(value, vt_types, "IN") ::routine test use arg space, title, centerPoint, radius say title if centerPoint~isA(.oleVariant) then say "space:" space "title:" title "centerPoint:" centerPoint "radius:" radius~string else say "space:" space "title:" title "centerPoint[1]:" centerPoint[1] "radius:" radius~string signal on syntax -- res=space~createCircle(centerPoint, radius) res=space~addCircle(centerPoint, radius) say "... SUCCESS!" "res="res "..." say return syntax: co=condition('o') tmp="";if centerPoint~isa(.string) then tmp="centerPoint="centerPoint "(a .String): " say tmp||"condition:" co~condition "message:" co~message say ":-(" say