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 / 2D Length Frame.d3m next >
Encoding:
Text File  |  2003-09-29  |  1.0 KB  |  31 lines

  1. ' This simple macro reads the length of the 2 selected curves, and 
  2. ' draws a 2D box laying on the ZY plane which is the bounding box for 
  3. ' the length of both the objects selected.
  4. '
  5. ' The first curve selected lays on the ZY axis and is the "side" curve,
  6. ' while the second curve selected lays on the XZ axis, and is the "top".
  7. '
  8. ' This program assumes you have first selected the profile curve, then 
  9. ' held down shift, and selected the top curve.  It assumes these 2 curves
  10. ' are the only objects selected, and that you selected them in that order.
  11. '
  12. ' Check to see if entities are selected
  13.   if Sys(34) = 0 then
  14.     Message "Please select 2 Curves and run this macro again."
  15.     End
  16.   endif
  17. ' Get Entity ID for the 1st selected curve
  18.     getselect 1, entID
  19. ' Get the length of the plane
  20.     Area1 = Length(entID)
  21. ' Get Entity ID for the 2nd selected curve
  22.     getselect 2, entID2
  23. ' Get the length of the plane
  24.     Area2 = Length(entID2)
  25. ' Draw Bounding Box based on length
  26.     >Box
  27.     {
  28.     <Pointxyz 0, 0, 0
  29.     <Pointrel 0, [Area1], [Area2]
  30.     }
  31. End