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 / Ortho-go3.d3m < prev    next >
Encoding:
Text File  |  2003-09-29  |  3.4 KB  |  112 lines

  1. setpoint "Set a point." 1        'Allows user to set a point
  2. pointval x1 y1 1            'and immediatly store it
  3. j=0                'initialize a counter
  4. sys(132)=0                'X placement of text window
  5. sys(133)=0                'Y placement of text window
  6. window 1,60                'size of window::::height,width
  7. locate 1, 5                'loaction of text in window
  8. print "Would you like to fit drawing to window after each segment?" 'text in window 
  9. anykey b$                'store user fitting response in b
  10. wclose                    'closes window
  11. DOOVER:                'goto here
  12. sys(132)=0                'X placement of text window
  13. sys(133)=0                'Y placement of text window
  14. window 1,50                'size of window::::height,width
  15. locate 1, 5                'loaction of text in window
  16. print "Enter the dirction as U, D, L, or R or Q to quit."  'text in window 
  17. anykey a$                'store user directional response in a
  18. wclose                    'closes window
  19. if a$ = "Q" then        'if quitting do following
  20. sys(132)=0                'X placement of text window
  21. sys(133)=0                'Y placement of text window
  22. window 1,60                'size of window::::height,width
  23. locate 1, 5                'loaction of text in window
  24. print "Would you like to keep current drawing selected?"  'text in window 
  25. anykey c$                'store user selection response in c
  26. wclose                    'closes window
  27. maxx=sys(122)            'retrieves largest x in drawing and stores in maxx
  28. if c$ = "N" then            'if the object is not to stay selected do following
  29.             'selection of point not in drawing 
  30.             'find largest x and add 5 so as to escape drawing
  31. >pointselect                
  32. {
  33. <type 0
  34. <pointxyz [maxx+5,y1]
  35. }
  36. endif                    'ends selection if 
  37. END                    'exits program
  38. endif                    'ends quitting if
  39. sys(130)=-10                'X placement of input box
  40. sys(131)=-10                'Y placement of input box
  41. input "Enter the Distance." dist    'allows user input into dist
  42. if (a$ = "U") then            'if direction response up do following
  43.             'draw line staring at current x,y going 
  44.             'user defined distance in upward direction
  45. >Line
  46. {
  47. <pointxyz [x1,y1]
  48. <pointpolar [dist,90]
  49. }
  50. y1=y1+dist            'set y to new y value
  51. end if                'ends upward if
  52. if (a$ = "D") then            'if direction response down do following
  53.             'draw line staring at current x,y going 
  54.             'user defined distance in downward direction
  55.  
  56. >Line
  57. {
  58. <pointxyz [x1,y1]
  59. <pointpolar [dist,270]
  60. y1=y1-dist            'set y to new y value
  61. }
  62. end if                 'ends downward if
  63. if (a$ = "L") then            'if direction response left do following
  64.             'draw line staring at current x,y going 
  65.             'user defined distance in leftward direction
  66.  
  67. >Line
  68. {
  69. <pointxyz [x1,y1]
  70. <pointpolar [dist,180]
  71. }
  72. x1=x1-dist            'set x to new x value
  73. end if                'ends leftward if 
  74. if (a$ = "R") then            'if direction response right do following
  75.             'draw line staring at current x,y going 
  76.             'user defined distance in rightward direction
  77.  
  78. >Line
  79. {
  80. <pointxyz [x1,y1]
  81. <pointpolar [dist,0]
  82. }
  83. x1=x1+dist            'set x to new x value
  84. end if                'ends rightward if
  85. j=j+1                    'increment j counter
  86. currentx=x1            'stores x value in current
  87. currenty=y1            'stores y value in current
  88.             'selects current entity
  89. >PointSelect
  90. {
  91. <type 1
  92. <pointxyz [currentx,currenty]
  93. }
  94. if j>1 then            'if there is only one line they can't be combined            
  95.             'combines all selected lines
  96. >Combine
  97. {
  98. }
  99. endif                'ends combine if
  100. if b$="Y" then            'if user wants drawing fit each time do following 
  101.             'fits drawing to current window
  102. >FitToWindow
  103. {
  104. }
  105.             'reselects object fit to window deselected
  106. >PointSelect
  107. {
  108. <type 0
  109. <pointxyz [x1,y1]
  110. }
  111. endif                'ends window fitting if
  112. goto DOOVER            'loops program till user enters Q to quit