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 / Length of Lines in Layers.d3m < prev    next >
Encoding:
Text File  |  2003-09-29  |  680 b   |  27 lines

  1. ' This simple macro adds the length of all the lines on each of
  2. ' the first five layers up, then allows the user to insert that 
  3. ' information into the drawing as a piece of text.
  4. '
  5. ' Change the 5 on the line below to add more layers, (up to 255)
  6.   for a=1 to 5
  7. '
  8. ' Set Precision to 1
  9.   Precision 1
  10.   d=a
  11.   L = 0
  12.   ' Loop through all entities in drawing
  13.     For J=1 to SYS(9)
  14.            GetAttr J, Type, Groupp, Layerr
  15.            If Type=1 AND Layerr=d Then L=L+LENGTH(J)
  16.     next 
  17. ' Create Text String
  18.   Text$ = "Length of Lines in Layer ",d, " is ",L
  19. ' Add text to drawing
  20.   >text  
  21.   {
  22.   <text "Lenghth of lines in layer number:"[Text$]
  23.   }
  24. Next
  25. End
  26.  
  27.