echord.sml

  Download

More scripts: C A D

Syntax Highlighing:

comments, key words, predefined symbols, class members & methods, functions & classes
            
# echord.sml
# demonstrate creating and reading an
# elliptical arc chord CAD element
clear();
# create a new file or open existing file
cad C;
GetOutputCAD(C);
# write an elliptical arc chord
numeric xin = 1000, yin = 2000, xSize = 500, ySize = 300, startAngle = 30;
numeric endAngle = 150, rotation = 45;
CADWriteEllipticalArcChord(C, 1, xin, yin, xSize, ySize, startAngle, endAngle, rotation);
# 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, sAngle, eAngle;
CADReadEllipticalArcChord(C, 1, lastelem, xCenter, yCenter, xSize, ySize, sAngle, eAngle, rotation);
print("write and read CAD elliptical arc chord");
string a$ = "element  xCenter  yCenter    ";
string b$ = "xSize    ySize   sAngle  eAngle rotation";
print(a$ + b$);
printf("%7d %8.2f %8.2f %8.2f %8.2f %8.2f%8.2f %8.2f \n",
lastelem, xCenter, yCenter, xSize, ySize, sAngle, eAngle, rotation);
CloseCAD(C);