point.sml

  Download

More scripts: C A D

Syntax Highlighing:

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