circle.sml

  Download

More scripts: C A D

Syntax Highlighing:

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