elemlist.sml

  Download

More scripts: C A D

Syntax Highlighing:

comments, key words, predefined symbols, class members & methods, functions & classes
            
# elemlist.sml
# demonstrates how to get a list of elements of a specified
# type in a block
# define array to hold element list - will be resized to fit
array numeric elemlist[10];
numeric elem;
clear();
cad C;
GetInputCAD(C);
numeric numElem = CADNumElements(C, 1);
# get list of lines
numeric numLines = CADGetElementList( C, 1, "Line", elemlist );
printf("number of elements: %4d number of lines: %4d \n", numElem, numLines);
print("Line list:\n");
for elem = 1 to numLines {
	printf("%4d %4d\n", elem, elemlist[elem]);
	}
CloseCAD(C);