home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2003 November / PCWK1103B.iso / DesignCAD 3D Max PLUS trial 30 / DATA1.CAB / Example_Files / Sample_Macros / Objects in Layers.d3m < prev    next >
Encoding:
Text File  |  2003-09-29  |  849 b   |  24 lines

  1. ' This simple macro asks users for a layer, cycles through
  2. ' the entire drawing counting the number of objects on that layer.
  3. ' Un-remark these next 2 lines to make the input box appear in the upper 
  4. ' left corner of the DesignCAD window, so it does not cover the drawing area.
  5.     ' Sys(130) = 5
  6.     ' Sys(131) = 5
  7. ' Truncate the number to the right of the decimal
  8.     Precision 0
  9. ' Get Layer from user
  10.     Input "Count Objects on Which Layer??", LayNum
  11. ' sys(9) is the number of entities
  12.     for j = 1 to sys(9)
  13.     ' Get the Attributes of each object
  14.         getattr j, type, grp, LayNum2
  15.     ' If this object is on the correct layer then
  16.           if LayNum = LayNum2 then
  17.             a = a + 1
  18.                   endif
  19. ' Get next Object
  20.     next j
  21. ' We've gone through the entire drawing, display results.
  22.     Message "There are ", a, " objects in layer ", LayNum
  23. End