More scripts: C A D

Syntax Highlighing:

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