Hello Kevin, I am trying to find my way around delphi syntax again after many years, and cannot find any relevant code examples, so have tried to convert the the vbs script above to create a sphere in Turbocad V18.
Here is some of my interpretation with a lot of assumptions, some of the code in the example may also not be needed. I just need to get one good working example to get me started.
I am using Delphi XE2 starter.
Any Help Appreciated!.
Mike Geraghty.
procedure TForm1.Button5Click(Sender: TObject);
var
TCApp: IMSIGX_TLB.IApplication;
TCDraw: IMSIGX_TLB.IDrawing;
TCSphere: IMSIGX_TLB.Graphic;
TCSphereProps: IMSIGX_TLB.Properties;
Verts: IMSIGX_TLB.Vertices;
{FileName: variant;}
begin
TCApp := GetActiveOleObject('TurboCAD.Application') as IApplication;
TCApp.Visible := True;
TCDraw := TCapp.Drawings.Add('');
TCSphere := TCDraw.Graphics.Add('TCW40SPHERE',1,0,45,67,0);{ Runs upto here, then says array index out of bounds}
TCSphereProps := TCSphere.Properties;
Verts := TCSphere.Vertices;
Verts.UseWorldCS := True;
Verts.Add(200,100,50,1,1,1,1,1,0,0,0);
Verts.Add(216.25,100,50,1,1,1,1,1,0,0,0);
TCSphere.Draw('');
TCSphereProps := nil;
TCSphere := nil;
Verts := nil;
TCDraw := nil;
TCApp := nil;
end;