arc.sml

  Download

More scripts: C A D

Syntax Highlighing:

comments, key words, predefined symbols, class members & methods, functions & classes
            
# arc.sml
# demonstrate creating and reading an arc CAD element
clear();
cad C;
GetOutputCAD(C); # create a new file or open existing file
# write an arc chord
numeric xin = 100, yin = 200, rin = 50, startAngle = 0, endAngle = 175;
CADWriteArc(C, 1, xin, yin, rin, startAngle, endAngle);
# the elements are always appended to end of block
# so get number of elements - last element will be ours
numeric lastelem = CADNumElements(C, 1);
# now read data for most recently added element
numeric xCenter, yCenter, radius, sAngle, eAngle;
CADReadArc(C, 1, lastelem, xCenter, yCenter, radius, sAngle, eAngle);
print("write and read CAD arc");
print("element  xCenter  yCenter   radius   sAngle   eAngle");
printf("%7d %8.2f %8.2f %8.2f %8.2f %8.2f \n", lastelem, xCenter, yCenter, radius, sAngle, eAngle);
CloseCAD(C);