|
TNTmips Downloads Menu

|
readblck.sml
# readblck.sml
# demonstrate how to read the number of blocks in a CAD object
# and then loop through all the blocks and print out type of each element
clear();
cad C;
GetInputCAD(C);
numeric numBlocks = CADNumBlocks(C);
print("number of blocks: ", numBlocks);
# loop through all blocks
numeric blk, elem;
for blk = 1 to numBlocks {
numeric numElements = CADNumElements(C, blk);
printf("block: %3d number of elements: %5d \n\n", blk, numElements);
# loop through all elements
for elem = 1 to numElements {
# get the element type
string elem$ = CADElementType(C, blk, elem);
printf("block: %3d element: %5d type: %s\n", blk, elem, elem$);
}
}
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
| |