The code:
Code: Select alllibrary Curves;
uses
URecords, // or 12
UConstants, // or 12
UInterfacesRecords, // or 12
UInterfaces, // or 12
SysUtils,
Classes;
{$E dmx}
{$R *.res}
type
TCurvesL = record
State: aSInt;
ADoCover, AIsClosed, ADoPolyline: Boolean;
case Byte of
1: (GetE: getescArg);
2: (CurveArg: CircMenuArg);
end ;
PCurvesL = ^TCurvesL;
function CurvesMain(act: action; pl, pargs: Pointer): wantType;
var
RetVal: aSInt;
L: PCurvesL;
begin
L := PCurvesL(pl);
if act = aagain then begin
case l.state of
1: begin
case l.GetE.Key of
f1: l.state := 2;
f3: l.state := 3;
f4: l.state := 4;
f5: l.state := 5;
f6: l.state := 6;
f7: l.state := 7;
f8: l.state := 8;
f0: l.state := 9;
S1: l.state := 10;
S2: l.state := 11;
S5: L.ADoPolyline := not L.ADoPolyline;
S6: L.AIsClosed := not L.AIsClosed;
S7: L.ADoCover := not L.ADoCover;
else
l.State := 0;
end;
end ;
2..11: l.state := 1;
else l.state := 0;
end;
end;
if act = afirst then begin
l.state := 1;
l.ADoCover := False;
l.AIsClosed := False;
l.ADoPolyline := False;
l.CurveArg.CircOpts.DoPolyline := False;
end else if act = alsize then begin
SetLocalSize(sizeof(l^));
end;
if act <> alsize then begin
wrterr('DCAL Macro Call Curve Menu - Version 1.0.');
case l.state of
1: begin
WrtLvl('Call Curve');
LblsInit;
LblSet(1, 'Curve');
LblSet(3, 'Arc2pt');
LblSet(4, 'Arc3pt');
LblSet(5, 'ArcCentAng');
LblSet(6, 'ArcCentArc');
LblSet(7, 'ArcCentChrd');
LblSet(8, 'ArcTan');
LblSet(10, 'CrcRad');
LblSet(11, 'CrcDia');
LblSet(12, 'Crc3pt');
LblSetT(15, 'DoPolyline', L.ADoPolyline);
LblSetT(16, 'IsClosed', L.AIsClosed);
LblSetT(17, 'DoCover', L.ADoCover);
LblSet(20, 'Exit');
LblsOn;
WrtMsg('Select function.');
GetEsc(l.gete, retval);
end;
2: begin
menuCurves(retval, L.CurveArg, L.ADoPolyline, @L.ADoCover, @L.AIsClosed);
end;
3: begin
menuArc2pt(retval, L.CurveArg, L.ADoPolyline, @L.ADoCover, @L.AIsClosed);
end;
4: begin
MenuArc3pt(retval, L.CurveArg, L.ADoPolyline, @L.ADoCover, @L.AIsClosed);
end;
5: begin
MenuArcCentAng(retval, L.CurveArg, L.ADoPolyline, @L.ADoCover, @L.AIsClosed);
end;
6: begin
MenuArcCentArc(retval, L.CurveArg, L.ADoPolyline, @L.ADoCover, @L.AIsClosed);
end;
7: begin
MenuArcCentChrd(retval, L.CurveArg, L.ADoPolyline, @L.ADoCover, @L.AIsClosed);
end;
8: begin
MenuArcTan(retval, L.CurveArg, L.ADoPolyline, @L.ADoCover, @L.AIsClosed);
end;
9: begin
MenuCrcRad(retval, L.CurveArg, L.ADoPolyline, @L.ADoCover, @L.AIsClosed);
end;
10: begin
MenuCrcDia(retval, L.CurveArg, L.ADoPolyline, @L.ADoCover, @L.AIsClosed);
end;
11: begin
MenuCrc3pt(retval, L.CurveArg, L.ADoPolyline, @L.ADoCover, @L.AIsClosed);
end;
else
retval := XDone;
end;
end;
Result := retval;
end ;
function Main(dcalstate: asint; act: action; pl, pargs: Pointer): wantType; stdcall;
begin
case dcalstate of
XDcalStateBegin: Result := CurvesMain(act, pl, pargs);
else Result := XDone;
end;
end;
exports
Main;
begin
end.
The problems:
in DataCAD11:
F1: Curve: ERROR, macro out, the drawing closed
F3-S2: Why does shown the Cover and the Close menuitem?
in DataCAD12: here drawing is correct, draw arc and circle, but
F1: Curve: menu call OK, but click maybe F2 menuitem (F1-S3), and why does shown the Cover and the Close menuitem?
F3-S2: Why does shown the Cover and the Close menuitem?
But (in DataCAD 11)
Code: Select all 2: begin
l.CurveArg.CircOpts.pDoPlineCover := @l.ADoCover;
l.CurveArg.CircOpts.pDoPlineClosed := @l.AIsClosed;
L.CurveArg.CircOpts.DoPolyline := L.ADoPolyline;
menuCurves(retval, L.CurveArg, L.ADoPolyline, @L.ADoCover, @L.AIsClosed);
end;
this case: macro call to curve menu, but
only the curve menu, polyline menu: no
exit from the curve menu, do not return the macro
Please help.
What is it the correct syntax in DataCAD11, that I can call the Curve menu, or call the Polyline menu and then return the macro?
Thanks before
ERT