home *** CD-ROM | disk | FTP | other *** search
/ Computer Buyer 1998 July / dpcb0798.bin / Creative / Cad / DEMO30 / MACROS.Z / SPRING.d3m < prev    next >
Text File  |  1997-04-15  |  2KB  |  76 lines

  1. input "how many loops? (0 to 20): ", nrev
  2. sangle = nrev * 360
  3. input "how many cross-section copies per loop? (1 to 20): ", ncrev
  4. ncpy = abs(ncrev * nrev)
  5. if ncpy > 198 then
  6.     message "Limit exceeded. Reduced copies per loop to ", 198/nrev
  7.     ncpy = 198
  8. end if
  9. size1:
  10. input "radius of wire: ", rwire
  11. input "distance between center of each loop: ", revoff
  12. offst = abs(revoff*nrev)
  13. if rwire > revoff/2 then
  14.     message "wire radius too large for given distance: try again"
  15.     goto size1
  16. end if
  17. size2:
  18. input "radius of spring (to center of wire): ", rcoil
  19. if rwire > rcoil then
  20.     message "wire radius larger than spring radius: try again"
  21.     goto size2
  22. end if
  23. dir:
  24. input "axial direction (X, Y, or Z):", adir$
  25. axoff = 0
  26. ayoff = 0
  27. azoff = 0
  28. if adir$ = "X" or adir$ = "x" then axoff = 1
  29. if adir$ = "Y" or adir$ = "y" then ayoff = 1
  30. if adir$ = "Z" or adir$ = "z" then azoff = 1
  31. input "radial direction (X, Y, or Z): ", rdir$
  32. xroff = 0
  33. yroff = 0
  34. zroff = 0
  35. if rdir$ = "X" or rdir$ = "x" then xroff = 1
  36. if rdir$ = "Y" or rdir$ = "y" then yroff = 1
  37. if rdir$ = "Z" or rdir$ = "z" then zroff = 1
  38. if (axoff=1 and xroff=1) or (ayoff=1 and yroff=1) or (azoff=1 and zroff=1) then
  39.     message "axial and radial directions must be different. Try again..."
  40.     goto dir
  41. end if
  42. sys(1) = 0
  43. 'message "about to set point"
  44. set:
  45. setpoint "Set a point for the first point on the axis: " 1
  46. if sys(1) < 1 then goto set
  47. pointval xc yc zc 1
  48. 'message "point recognized:", xc, yc, zc
  49. sys(1) = 0
  50. >circle
  51. {
  52.     <type 2
  53.     <pointxyz [xc + xroff*rcoil, yc + yroff*rcoil, zc + zroff*rcoil]
  54.     <pointrel [xroff*rwire, yroff*rwire, zroff*rwire]
  55.     <pointrel [axoff, ayoff, azoff]
  56. }
  57. >3dselectmode
  58. {
  59. }
  60. >pointselect
  61. {
  62.     <pointxyz [xc + xroff*rcoil, yc + yroff*rcoil, zc +zroff*rcoil]
  63. }
  64. >sweep
  65. {
  66.     <axis [ayoff*1 + azoff*2]
  67.     <ncopy [ncpy]
  68.     <angle [sangle]
  69.     <offset [offst]
  70.     <pointxyz [xc, yc, zc]
  71. }
  72.  
  73.  
  74.  
  75.  
  76.