ellipse.sml
# ellipse.sml
# demonstrate creating and reading an ellipse CAD element
clear();
cad C;
GetOutputCAD(C); # create a new file or open existing file
# write an ellipse
numeric xin = 1000, yin = 2000, xSize = 500, ySize = 300, rotation = 45;
CADWriteEllipse(C, 1, xin, yin, xSize, ySize, rotation);
# the elements are always appended to end of block
# so get number of elements - last element will be our ellipse
numeric lastelem = CADNumElements(C, 1);
# now read ellipse data for most recently added element
numeric xCenter, yCenter;
CADReadEllipse(C, 1, lastelem, xCenter, yCenter, xSize, ySize, rotation);
print("write and read CAD ellipse");
print("element xCenter yCenter xSize ySize rotation");
printf("%7d %8.2f %8.2f %8.2f %8.2f %8.2f \n", lastelem, xCenter, yCenter, xSize, ySize, rotation);
CloseCAD(C);
©MicroImages, Inc. 2013 Published in the United States of America
11th Floor - Sharp Tower, 206 South 13th Street, Lincoln NE 68508-2010 USA
Business & Sales: (402)477-9554 Support: (402)477-9562 Fax: (402)477-9559
Business info@microimages.com
Support support@microimages.com
Web webmaster@microimages.com
|