More scripts: C A D

Syntax Highlighing:

comments, key words, predefined symbols, class members & methods, functions & classes
# arcwedge.sml
# demonstrate creating and reading an arc wedge CAD element
cad C;
GetOutputCAD(C); # create a new file or open existing file
# write an arc wedge
numeric xin = 100, yin = 200, rin = 50, startAngle = 0, endAngle = 175;
CADWriteArcWedge(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;
CADReadArcWedge(C, 1, lastelem, xCenter, yCenter, radius, sAngle, eAngle);
print("write and read CAD arc wedge");
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);