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 / Deck_Slice2.d3m < prev    next >
Encoding:
Text File  |  2003-09-29  |  29.3 KB  |  1,317 lines

  1. ' BasicCAD Program to draw a Sliced Deck 
  2. ' Deck Data is stored in an ASCII data file in the 
  3. ' Sample Macros folder.
  4. '
  5. ' Program Settings
  6.     Sys(242) = 0                      ' Turn off Select Object when Created for now
  7. '    Sys(800) = 1                      ' Turn on Tracing Mode Dialog
  8.     Sys(36) = 1                       ' Turn on Silent Mode
  9.     Sys(243) = 0                ' Turn off Shade when Created
  10.     Precision 4
  11. '
  12. ' Items in Layers
  13. '       Layer 1 Posts
  14. '       Layer 2 Deck Outline on ground
  15. '      Layer 3 Beams
  16. '      Layer 4 Deck Frame
  17. '      Layer 5 Deck Joists
  18. '        Layer 6 Decking
  19. '    Layer 15 Attributes
  20. '
  21. ' All Deck Distance Variable names follow this format
  22. '       Character 1; F or I for Feet or Inches
  23. '       Character 2; X, Y, or Z for Axis
  24. '       Character 3; D for Deck, P for Post, B for Beam, J for Joist, etc.
  25. '      Character 4; T for Total, (Optional)
  26. '
  27. ' Declare and initialize Public Variables
  28. '
  29. ' Start Progress Bar
  30.     Progress 1 "Drawing Deck, Please Wait . . . "
  31. '
  32. ' Get Values from ASCII text file
  33.     open "i", 1, "*\Sample Macros\Deck_Slice2.txt"
  34. ' Deck Variables
  35.  
  36. ' Get Deck Width
  37.         input #1, temp$
  38.     temp2$ = LEFT$(temp$, 8)
  39.     FXDwide = VAL(temp2$)            ' Deck Width
  40.     IXDwide = FXDwide * 12              ' Deck Width
  41. ' Get Deck Depth
  42.         input #1, temp$
  43.     temp2$ = LEFT$(temp$, 5)
  44.     FZDdeep = VAL(temp2$)             ' Deck Depth
  45.     IZDdeep = FZDdeep * 12              ' Deck Depth
  46. ' Get Deck Height
  47.         input #1, temp$
  48.     temp2$ = LEFT$(temp$, 5)
  49.     FYDhigh = VAL(temp2$)             ' Deck Height
  50.     IYDhigh = FYDhigh * 12              ' Deck Height
  51. ' Get Deck Overhang
  52.         input #1, temp$
  53.     temp2$ = LEFT$(temp$, 5)
  54.     FXDover = VAL(temp2$)             ' Max. Allowed Overhang
  55.     IXDover = FXDover * 12              ' Max. Allowed Overhang
  56. ' Get Deck Overhang
  57.         input #1, temp$
  58.     temp2$ = LEFT$(temp$, 5)
  59.     FZDover = VAL(temp2$)             ' Max. Allowed Overhang
  60.     IZDover = FZDover * 12              ' Max. Allowed Overhang
  61. ' Get Length Between Posts
  62.         input #1, temp$
  63.     temp2$ = LEFT$(temp$, 5)
  64.     FXPlbep = VAL(temp2$)             ' Length Between Posts
  65.     IXPlbep = FXPlbep * 12              ' Length Between Posts
  66. ' Get Post Width
  67.         input #1, temp$
  68.     temp2$ = LEFT$(temp$, 5)
  69.     IXPwide = VAL(temp2$)             ' Post Width
  70.  
  71.     IXPhwide = IXPwide / 2              ' Post Width / 2 on X
  72.     IZPhdeep = IXPwide / 2              ' Post Depth / 2 on Z
  73. ' Get Space Between Beams    
  74.         input #1, temp$
  75.     temp2$ = LEFT$(temp$, 5)
  76.     FZBdeep = VAL(temp2$)             ' Space Between Beams    
  77.     IZBdeep = FZBdeep * 12              ' Space Between Beams
  78. ' Get Beam Height    
  79.         input #1, temp$
  80.     temp2$ = LEFT$(temp$, 5)
  81.     IYBhigh = VAL(temp2$)             ' Beam Height
  82. ' Get Beam Depth    
  83.         input #1, temp$
  84.     temp2$ = LEFT$(temp$, 5)
  85.     IZBdepe = VAL(temp2$)             ' Beam Depth
  86. ' Get Beam Width    
  87.         input #1, temp$
  88.     temp2$ = LEFT$(temp$, 5)
  89.     FXBwide = VAL(temp2$)            ' Beam Width
  90.     IXBwide = FXBwide * 12             ' Beam Width
  91. ' Get Joist Height    
  92.         input #1, temp$
  93.     temp2$ = LEFT$(temp$, 5)
  94.     IYJhigh = VAL(temp2$)             ' Joist Height
  95. ' Get Joist Depth
  96.         input #1, temp$
  97.     temp2$ = LEFT$(temp$, 5)
  98.     FZJdepe = VAL(temp2$)            ' Joist Depth
  99.     IZJdepe = FZJdepe * 12             ' Joist Depth
  100. ' Get Joist Width
  101.         input #1, temp$
  102.     temp2$ = LEFT$(temp$, 5)
  103.     IXJwide = VAL(temp2$)             ' Joist Width
  104. ' Get Joist Spacing
  105.         input #1, temp$
  106.     temp2$ = LEFT$(temp$, 5)
  107.     IXJcent = VAL(temp2$)            ' Joist Center Spacing
  108. ' Get Decking Height
  109.         input #1, temp$
  110.     temp2$ = LEFT$(temp$, 5)
  111.     IYKhigh = VAL(temp2$)            ' Decking Height
  112. ' Get Decking Depth
  113.         input #1, temp$
  114.     temp2$ = LEFT$(temp$, 5)
  115.     IZKdepe = VAL(temp2$)            ' Decking Depth
  116. ' Get Decking Spacing
  117.         input #1, temp$
  118.     temp2$ = LEFT$(temp$, 5)
  119.     IXZKspc = VAL(temp2$)            ' Decking Spacing
  120. ' Get Deck Type
  121.         input #1, temp$
  122.     temp2$ = LEFT$(temp$, 5)
  123.     Dvalue = VAL(temp2$)            ' Deck Type
  124. ' Get Post Type
  125.         input #1, temp$
  126.     PostType$ = temp$                ' Post Type String
  127. ' Get Beam Type
  128.         input #1, temp$
  129.     BeamType$ = temp$                ' Beam Type String
  130. ' Get Joist Type
  131.         input #1, temp$
  132.     JoisType$ = temp$                ' Joist Type String    
  133. ' Get Decking String
  134.         input #1, temp$
  135.     Decking$ = temp$                ' Decking String    
  136. ' Get Shading String
  137.         input #1, Shade
  138. Close #1
  139.   IXPtlen = IXDwide - (2 * IXPoffs)             ' Total Width Available for Posts after Subtracting Overhang
  140.   IZPtlen = IZDdeep - (2 * IZPoffs)             ' Total Depth Available for Posts after Subtracting Overhang
  141.   IXKwide = ((3 * IXJcent) - IXZKspc)        ' Calculated Width of Decking
  142.   IXZJovr = ((IXJwide - IXZKspc) / 2)        ' Calculated Overlap for Decking across Width of Joist
  143.   IYPhigh = 0                          ' Calculated Post Height
  144.   NumoPstX = 0                        ' Calculated number of Posts for Deck Width
  145.   NumoBmsZ = 0                        ' Calculated number of Beams for Deck Depth
  146.   NumoJstX = 0                    ' Calculated number of Joists for Deck Width
  147.   NumoDckZ = 0                    ' Calculated number of Rows of Decking for Deck Depth Divided by 3
  148.                          ' 3 Rows are Initially Drawn and All 3 are then Arrayed
  149.                          ' The Rows of Decking is All Rows of Decking Needed so It Needs to be Divided by 3
  150. '
  151. ' Misc Variables
  152.   tn1 = 0                          ' Numeric Local Placeholder
  153.   t1$ = ""                          ' String Local Placeholder
  154.   ps1 = 0                          ' Temp Numeric Value passed to Status subroutine
  155.   ps2 = 0                          ' Temp Numeric Value divided by 12
  156.   ps3 = 0                          ' Temp Numeric Value multiplied by 12
  157.   ps$ = ""                          ' Temp String Variable
  158.  
  159. '
  160. ' Calculate Post Height
  161. ' Add Beam height + Joist Height
  162.     tn1 = IYBhigh + IYJhigh
  163. ' Subtract the sum from the deck height in inches
  164.       IYPhigh = IYDhigh - tn1
  165. '      ps1 = IYPhigh
  166. '      gosub status
  167. '
  168. ' Calculate Number of Posts Needed for Width
  169. ' Total Width Available for Posts
  170.  
  171.     IXPtlen = IXDwide - (2 * IXDover)
  172.  
  173. ' Number of Posts is Total Width Available for Posts divided by Length between Posts
  174.  
  175.     NumoPstX = IXPtlen / IXPlbep
  176.     NumoPstX = ROUND (NumoPstX)
  177.     ' Distance Between Posts is refigured as Total Width Available for Posts Divided by the Newly figured Number of Posts
  178.     IXPlbep = IXPtlen / NumoPstX
  179. '      ps1 =NumoPstX
  180. '      gosub status
  181. '
  182. '    IXPlbep = IXPlbep / 2
  183. '    NumoPstX = NumoPstX * 2
  184. ' Draw Posts for Deck Width
  185. '
  186. ' Posts go on Layer 1
  187.     SYS(3)=1
  188.       SYS$(93) = "Posts"    
  189. ' Set Drawing Options
  190.     ' Use Left Hand Coordinate System
  191.         Sys(110) = -1
  192.             '
  193.     ' Select Object when Created
  194.         Sys(242) = 1
  195.             '
  196.     ' Set Local Origin Location
  197.         LOriginX = 0 + IXDover
  198.             LOriginY = 0
  199.             LOriginZ = 0 + IZDover
  200.     ' Make sure we're in 3D
  201.         if Sys(344) = 1 then
  202.             >2DMode
  203.             {
  204.               }
  205.         endif
  206.     ' Make sure were in wireframe mode
  207. for a = 1 to 4
  208.     Sys(71) = a
  209.     Sys(2) = 0
  210. next a
  211.     Sys(71) = 1
  212. ' Draw the First Post
  213.      >Box
  214.           {
  215.          <PointXYZ [LOriginX - IXPhwide, LOriginY, LOriginZ - IZPhdeep]
  216.           <PointXYZ [LOriginX + IXPhwide, IYPhigh, LOriginZ + IZPhdeep]
  217.           }
  218. ' >>> Select Layers 1, Posts
  219.     >SelectLayer
  220.     {
  221.     <Layer 1
  222.     }
  223. ' Set current Material to Cherry
  224.     Sys(349) = 5
  225. ' Set current color for Oak Material
  226.     Sys(350) = 177
  227.     Sys(351) = 76
  228.     Sys(352) = 51
  229. ' Apply Current Material and Color to Layers
  230.     >ApplyMaterial
  231.     {
  232.     }
  233.     >ApplyColor
  234.     {
  235.     }
  236. ' Set the Post's center handle
  237.      >SetHandle
  238.           {
  239.          <Pointxyz [LOriginX, LOriginY, LOriginZ]
  240.           }
  241.      >FitToAllWindow
  242.           {
  243.           }
  244. ' Array the Post for Width
  245.      >Array
  246.           {
  247.         <PointXYZ [LOriginX + IXPlbep, LOriginY,  LOriginZ]
  248.     ' NumoPstX + 1 is Neccessary because DesignCAD Arrays with more than one entity only
  249.         <NCopy [NumoPstX + 1,1,1]
  250.         <AlongCurve 0
  251.         <Perpendicular 0
  252.         }
  253. ' >>> Material List
  254.     att$ = PostType$
  255.     gosub DeckData
  256.     >Array
  257.           {
  258.         <PointXYZ 10, 10, 10
  259.         <NCopy [NumoPstX,1,1]
  260.         <AlongCurve 0
  261.         <Perpendicular 0
  262.         }
  263.      >SelectAll
  264.          {
  265.           }
  266. '
  267. ' Update Progress Bar
  268.     Progress 10 100
  269. '
  270. ' Set the Post's center handle
  271.      >SetHandle
  272.           {
  273.           <PointXYZ [LOriginX, LOriginY, LOriginZ]
  274.           }
  275.      >FitToAllWindow
  276.          {
  277.           }
  278. ' Total Depth Available for Posts
  279.  
  280.     IZPtlen = IZDdeep - (2 * IZDover)
  281.  
  282. ' Calculate Number of Posts Needed for Depth
  283.     
  284.     NumoBmsZ = IZPtlen / IZBdeep
  285.     NumoBmsZ = ROUND (NumoBmsZ)
  286.     ' Distance Between Posts is refigured as Total Depth Available for Posts Divided by the Newly figured Number of Posts
  287.     IZBdeep = IZPtlen / NumoBmsZ
  288.  
  289. ' Draw Posts for Deck Depth
  290. ' Array the Post for Depth
  291.      >Array
  292.     {
  293.         <PointXYZ [LOriginX,  LOriginY, LOriginZ + IZBdeep]
  294.         <NCopy [1,1,NumoBmsZ + 1]
  295.         <AlongCurve 0
  296.         <Perpendicular 0
  297.         }
  298. ' >>> Material List
  299.     att$ = PostType$
  300.     gosub DeckData
  301.     >Array
  302.           {
  303.         <PointXYZ 10, 10, 10
  304.         <NCopy [NumoBmsZ + 1,1,1]
  305.         <AlongCurve 0
  306.         <Perpendicular 0
  307.         }
  308. ' If Deck is less than 24 feet wide, add supporting posts
  309. '     if FXDwide < 24 then
  310. '    If FXDwide > 17 then
  311. '        LOriginX = IXDwide / 3
  312. '        LOriginY = 0
  313. '        LOriginZ = IZDdeep - IZDover
  314. '        >Box
  315. '              {
  316. '             <PointXYZ [LOriginX - IXPhwide, LOriginY, LOriginZ - IZPhdeep]
  317. '              <PointXYZ [LOriginX + IXPhwide, IYPhigh, LOriginZ + IZPhdeep]
  318. '              }
  319. '        KDW5 = IXDwide / 3
  320. '        LOriginX = IXDwide - KDW5
  321. '        >Box
  322. '              {
  323. '             <PointXYZ [LOriginX - IXPhwide, LOriginY, LOriginZ - IZPhdeep]
  324. '              <PointXYZ [LOriginX + IXPhwide, IYPhigh, LOriginZ + IZPhdeep]
  325. '              }
  326. '    ' >>> Select Layers 1, Posts
  327. '        >SelectLayer
  328. '        {
  329. '        <Layer 1
  330. '        }
  331. '    ' Set current Material to Cherry
  332. '        Sys(349) = 5
  333. '    ' Set current color for Oak Material
  334. '        Sys(350) = 177
  335. '        Sys(351) = 76
  336. '        Sys(352) = 51
  337. '    ' Apply Current Material and Color to Layers
  338. '        >ApplyMaterial
  339. '        {
  340. '        }
  341. '        >ApplyColor
  342. '        {
  343. '        }
  344. '    endif
  345. '    endif
  346. ' Draw Deck Outline
  347.   ' Deck outline goes on Layer 2
  348.         SYS(3)=2
  349.         SYS$(93) = "Deck_Outline"    
  350.      >Box
  351.     {
  352.         <PointXYZ 0,0,0
  353.         <PointRel [IXDwide, 0, IZDdeep]
  354.         }
  355. ' Set Line for Slice for Truncated Portion
  356. ' Deck Width / 3
  357.     Ted1 = IXDwide / 3
  358. ' Deck Depth / 3
  359.     Ted2 = IZDdeep / 3
  360.      >Line
  361.     {
  362.     <PointXYZ [IXDwide - Ted1, 0, IZDdeep]
  363.     <PointXYZ [IXDwide, 0, IZDdeep - Ted2]
  364.     }
  365.      >Line
  366.     {
  367.     <PointXYZ [0, 0, IZDdeep - Ted2]
  368.     <PointXYZ [Ted1, 0, IZDdeep]
  369.     }
  370.     >FitToAllWindow
  371.         {
  372.         }
  373. ' Select Layer2, Deck Outline
  374.     >SelectLayer
  375.     {
  376.     <Layer 2
  377.     }
  378. ' Set current Material to Leaves
  379.     Sys(349) = 12
  380. ' Set current color for Oak Material
  381.     Sys(350) = 107
  382.     Sys(351) = 255
  383.     Sys(352) = 143
  384. ' Apply Current Material and Color to Layers
  385.     >ApplyMaterial
  386.     {
  387.     }
  388.     >ApplyColor
  389.     {
  390.     }
  391. '
  392. ' Update Progress Bar
  393.     Progress 20 100
  394. '
  395. ' Draw the Beams
  396.   ' Beams go on Layer 3
  397.         SYS(3)=3
  398.         SYS$(93) = "Beams"    
  399. ' Get Z Starting Point
  400. ' Z offset - Post Width
  401.     tn1 = IZDover - IXPwide
  402. '
  403. ' Loop for Beams Thru Width
  404. a = 0
  405. b = 0
  406. do while a < IXDwide
  407. ' Draw the 1st Beam
  408.      >Box
  409.         {
  410.         <Pointxyz [a],[IYPhigh],[IZDover - IZPhdeep]
  411.         <PointRel [IXBwide,-IYBhigh, -IZBdepe]
  412.        }
  413. ' Draw the 2nd Beam
  414.      >Box
  415.         {
  416.         <Pointxyz [a],[IYPhigh],[IZDover + IZPhdeep + IZBdepe]
  417.         <PointRel [IXBwide,-IYBhigh, -IZBdepe]
  418.         }
  419.   a = a + IXBwide
  420.   b = b + 1
  421. loop
  422. ' >>> Material List, Beam Width
  423.     att$ = BeamType$
  424.     gosub DeckData
  425.          >Array
  426.           {
  427.         <PointXYZ 10, 10, 10
  428.         <NCopy [b, 0, 0]
  429.         <AlongCurve 0
  430.         <Perpendicular 0
  431.         }
  432.      >SelectLayer
  433.     {
  434.     <Layer 3
  435.     }
  436. ' Update Progress Bar
  437.     Progress 25 100
  438. '
  439. '
  440. ' Select Layers 3 and 6
  441. ' Decking and Beams
  442. '
  443.     >SelectLayer
  444.     {
  445.     <Layer 3
  446.     <Layer 6
  447.     }
  448. ' Set current Material to Oak
  449.     Sys(349) = 14
  450. ' Set current color for Oak Material
  451.     Sys(350) = 255
  452.     Sys(351) = 182
  453.     Sys(352) = 74
  454. ' Apply Current Material and Color to Layers
  455.     >ApplyMaterial
  456.     {
  457.     }
  458.     >ApplyColor
  459.     {
  460.     }
  461. ' Not Using Sys(242) to set Handles
  462.  ' Select Objects when Created on
  463.  '  Sys(242) = 1
  464.  
  465. ' Set the Beam's handle
  466.      >SetHandle
  467.           {
  468.         <PointXYZ [0, IYPhigh, 0]
  469.           }
  470. ' Array the Beams for Depth
  471.      >Array
  472.           {
  473.         <PointXYZ [0, IYPhigh, IZBdeep]
  474.         <NCopy [NumoBmsZ + 1, 0, 0]
  475.         <AlongCurve 0
  476.         <Perpendicular 0
  477.         }
  478. ' >>> Material List, Beam Depth
  479.     att$ = BeamType$
  480.     gosub DeckData
  481.          >Array
  482.           {
  483.         <PointXYZ 10, 10, 10
  484.         <NCopy [NumoBmsZ * 2, 0, 0]
  485.         <AlongCurve 0
  486.         <Perpendicular 0
  487.         }
  488. ' Update Progress Bar
  489.     Progress 30 100
  490.     ' Section to delete, then redraw beams
  491.     ' Select old beams first
  492.         >SelectLayer
  493.         {
  494.         <Layer 3
  495.         }
  496.     ' Delete beams
  497.         >SelectDelete
  498.         {
  499.         }
  500.     ' Draw the 1st Beam
  501.         >Box
  502.             {
  503.             <Pointxyz 0, [IYPhigh],[IZDover - IZPhdeep]
  504.             <PointRel [IXDwide,-IYBhigh, -IZBdepe]
  505.            }
  506.     ' Draw the 2nd Beam
  507.              >Box
  508.             {
  509.             <Pointxyz 0,[IYPhigh],[IZDover + IZPhdeep + IZBdepe]
  510.             <PointRel [IXDwide,-IYBhigh, -IZBdepe]
  511.             }
  512.          ' Select new beams
  513.         >SelectLayer
  514.         {
  515.         <Layer 3
  516.         }
  517.     ' Set the Beam's handle
  518.              >SetHandle
  519.               {
  520.             <PointXYZ [0, IYPhigh, 0]
  521.               }
  522.     ' Array the Beams for Depth
  523.              >Array
  524.               {
  525.             <PointXYZ [0, IYPhigh, IZBdeep]
  526.             <NCopy [NumoBmsZ + 1, 0, 0]
  527.             <AlongCurve 0
  528.             <Perpendicular 0
  529.             }
  530. '
  531. ' Update Progress Bar
  532.     Progress 30 100
  533. '
  534. ' Select Layers 3 and 6
  535. ' Decking and Beams
  536. '
  537.     >SelectLayer
  538.     {
  539.     <Layer 3
  540.     <Layer 6
  541.     }
  542. ' Set current Material to Oak
  543.     Sys(349) = 14
  544. ' Set current color for Oak Material
  545.     Sys(350) = 255
  546.     Sys(351) = 182
  547.     Sys(352) = 74
  548. ' Apply Current Material and Color to Layers
  549.     >ApplyMaterial
  550.     {
  551.     }
  552.     >ApplyColor
  553.     {
  554.     }
  555. '
  556. ' Beams will be Used for Deck Frame to Save on Materials Cost
  557. ' If neccessary New Variables May be Used in place of Beam Variables Should This Condition Change
  558. ' Draw the Frame
  559.   ' Frame go on Layer 4
  560.         SYS(3)=5
  561.         SYS$(93) = "Joists"
  562. ' Loop for Front of Frame Thru Width
  563. a = 0
  564. b = 0
  565. do while a < IXDwide
  566. ' Draw the Front of Frame
  567.      >Box
  568.         {
  569.         <Pointxyz [a, IYPhigh + IYJhigh, IZBdepe]
  570.         <PointRel [IXBwide,-IYJhigh, -IZBdepe]
  571.        }
  572.   a = a + IXBwide
  573. b = b + 1
  574. loop
  575. ' >>> Material List, Deck Frame Width
  576.     att$ = BeamType$
  577.     gosub DeckData
  578.          >Array
  579.           {
  580.         <PointXYZ 10, 10, 10
  581.         <NCopy [b, 0, 0]
  582.         <AlongCurve 0
  583.         <Perpendicular 0
  584.         }
  585.  
  586.      >SelectLayer
  587.     {
  588.     <Layer 5
  589.     }
  590. ' Set the Front Panel's handle
  591.      >SetHandle
  592.           {
  593.         <PointXYZ [0, IYPhigh, 0]
  594.           }
  595. ' Mirror the Front
  596.      >Mirror
  597.           {
  598.         <PointXYZ [0, IYPhigh + IYJhigh, IZDdeep - IZBdepe]
  599.     <Axis 1
  600.     <Type 1
  601.     }
  602. ' >>> Material List, Deck Frame Width
  603.     att$ = BeamType$
  604.     gosub DeckData
  605.     >Array
  606.          {
  607.         <PointXYZ 10, 10, 10
  608.         <NCopy [b, 0, 0]
  609.         <AlongCurve 0
  610.         <Perpendicular 0
  611.         }
  612.  
  613. ' Loop for Side of Frame Thru Depth
  614. a = 0
  615. b = 0
  616. do while a < IZDdeep
  617. ' Draw the Side Panel of Frame
  618.      >Box
  619.         {
  620.         <PointXYZ [IXDwide - IZBdepe, IYPhigh + IYJhigh, a + IZBdepe]
  621.         <PointRel [IZBdepe, -IYJhigh, IXBwide]
  622.        }
  623.   a = a + IXBwide
  624. b = b + 1
  625. loop
  626. ' >>> Material List, Deck Frame Depth
  627.     att$ = JoisType$
  628.     gosub DeckData
  629.          >Array
  630.           {
  631.         <PointXYZ 10, 10, 10
  632.         <NCopy [b, 0, 0]
  633.         <AlongCurve 0
  634.         <Perpendicular 0
  635.         }
  636. ' Update Progress Bar
  637.     Progress 35 100
  638. '
  639. ' Draw the Joists
  640.   ' Joists go on Layer 5
  641.         SYS(3)=5
  642.         SYS$(93) = "Joists"
  643. ' Draw the First Joist
  644. a = 0
  645. ted3 = IZDover - IZBdepe
  646. KDW1 = IZBdeep * 2
  647. KDW2 = KDW1 + IZDover
  648. >Box
  649.         {
  650.         <PointXYZ [0, IYPhigh + IYJhigh, 0]
  651.         <PointRel [IXJwide, -IYJhigh, KDW2]
  652.        }
  653. ' Loop for 1st Joist
  654. a = ted3
  655. a = KDW2
  656. b = 0
  657. do while a < IZDdeep
  658.      >Box
  659.         {
  660.         <PointXYZ [0, IYPhigh + IYJhigh, a]
  661. '        <PointRel [IXJwide, -IYJhigh, IZJdepe]
  662.         <PointRel [IXJwide, -IYJhigh, KDW2 - IZDover]
  663.        }
  664. b = b + 1
  665. a = a + KDW1
  666. loop
  667. ' Select Layers 4 and 5
  668. ' Deck Frame and Joists
  669.     >SelectLayer
  670.     {
  671.     <Layer 4
  672.     <Layer 5
  673.     }
  674. ' Set current Material to Walnut
  675.     Sys(349) = 21
  676. ' Set current color for Oak Material
  677.     Sys(350) = 177
  678.     Sys(351) = 102
  679.     Sys(352) = 25
  680. ' Apply Current Material and Color to Layers
  681.     >ApplyMaterial
  682.     {
  683.     }
  684.     >ApplyColor
  685.     {
  686.     }
  687. ' >>> Material List, Joists, first row
  688. ' b is one too large, so subtract one
  689.     att$ = JoisType$
  690.     gosub DeckData
  691.          >Array
  692.           {
  693.         <PointXYZ 10, 10, 10
  694.         <NCopy [b - 1, 0, 0]
  695.         <AlongCurve 0
  696.         <Perpendicular 0
  697.         }
  698.  
  699.      >SelectLayer
  700.     {
  701.     <Layer 5
  702.     }
  703. ' Set the Joist's handle
  704.      >SetHandle
  705.           {
  706.         <PointXYZ [0, IYPhigh, 0]
  707.           }
  708. ' Array the Joists for Width
  709.      >Array
  710.           {
  711.         <PointXYZ [IXJcent, IYPhigh, 0]
  712.     NumoJstX = IXDwide / IXJcent
  713.     ' NumoJstX + 1 is Neccessary because DesignCAD Arrays with more than one entity only
  714.         <NCopy [NumoJstX + 1,1,1]
  715.         <AlongCurve 0
  716.         <Perpendicular 0
  717.         }
  718. ' >>> Material List, Joists, array
  719. ' gets b from above for extreme left row # of Joists, * the array to the right
  720.     att$ = JoisType$
  721.     gosub DeckData
  722.          >Array
  723.           {
  724.         <PointXYZ 10, 10, 10
  725.         <NCopy [NumoJstX * b, 0, 0]
  726.         <AlongCurve 0
  727.         <Perpendicular 0
  728.         }
  729. ' Update Progress Bar
  730.     Progress 40 100
  731. '
  732. ' Slice the Back of Deck for Scraps
  733.      >Slice
  734.         {
  735.         <Pointxyz 0, 0, [IZDdeep]
  736.         <Pointxyz [IXDwide], 0, [IZDdeep]
  737.         <Pointxyz [IXDwide], 2, [IZDdeep]
  738.         <Pointxyz [IXDwide], 2, [IZDdeep + 10]
  739.         }
  740. ' Draw the Decking
  741.   ' Decking goes on Layer 6
  742.         SYS(3)=6
  743.         SYS$(93) = "Decking"
  744. ' Decking Pattern is Determined by the PointXYZ of the 1st and 2nd Piece of Decking
  745.  ' The Current Pattern is the 1st Piece of the 1st Row Covers up to the 1st Joist
  746.  ' The 1st Piece of the 2nd Row Covers up to the 2nd Joist
  747.  ' While the 1st Piece of the 3rd Row Covers up to the 3rd Joist
  748.  
  749. ' Draw the 1st Row of Decking
  750.   ' Draw 1st Piece of Decking for 1st Row
  751.      >Box
  752.         {
  753.         <PointXYZ [0, IYPhigh + IYJhigh + IYKhigh, 0]
  754.         <PointRel [IXJcent + IXZJovr, -IYKhigh, IZKdepe]
  755.        }
  756. ' Loop for First Row of Decking
  757. a = 0
  758. b = 0
  759. ted = IXDwide
  760.  if IXDwide => 20 then
  761.     ted = IXDwide - IXKwide
  762.  endif
  763. do while a < ted
  764. ' Draw 2nd Piece of Decking for 1st Row
  765.      >Box
  766.         {
  767.         <PointXYZ [a + IXJcent + IXZJovr + IXZKspc, IYPhigh + IYJhigh + IYKhigh, 0]
  768.         <PointRel [IXKwide, -IYKhigh, IZKdepe]
  769.        }
  770.     if a < IXDwide then
  771.      a = a + IXKwide + IXZKspc
  772.     endif
  773. b = b + 1
  774. loop
  775. ' >>> Material List, Decking, first row
  776. ' + 1 because we drew a piece of decking outside the loop above first
  777.     att$ = Decking$
  778.     gosub DeckData
  779.         >Array
  780.           {
  781.         <PointXYZ 10, 10, 10
  782.         <NCopy [b + 1,1,1]
  783.         <AlongCurve 0
  784.         <Perpendicular 0
  785.         }
  786. ' Remember b for later
  787. RowOne = b
  788. ' Update Progress Bar
  789.     Progress 50 100
  790.  
  791. ' Draw the 2nd Row of Decking
  792.   ' Draw 1st Piece of Decking for 2nd Row
  793.      >Box
  794.         {
  795.         <PointXYZ [0, IYPhigh + IYJhigh + IYKhigh, IZKdepe + IXZKspc]
  796.         <PointRel [2*IXJcent + IXZJovr, -IYKhigh, IZKdepe]
  797.        }
  798. ' Loop for 2nd Row of Decking
  799. a = 0
  800. b = 0
  801. ted = IXDwide - IXKwide
  802. do while a < ted
  803. ' Draw 2nd Piece of Decking for 2nd Row
  804.      >Box
  805.         {
  806.         <PointXYZ [a + 2*IXJcent + IXZJovr + IXZKspc, IYPhigh + IYJhigh + IYKhigh, IZKdepe + IXZKspc]
  807.         <PointRel [IXKwide, -IYKhigh, IZKdepe]
  808.        }
  809.     if a < IXDwide then
  810.      a = a + IXKwide + IXZKspc
  811.     endif
  812.   b = b + 1
  813. loop
  814. ' >>> Material List, Decking, first row
  815. ' + 1 because we drew a piece of decking outside the loop above first
  816.     att$ = Decking$
  817.     gosub DeckData
  818.         >Array
  819.           {
  820.         <PointXYZ 10, 10, 10
  821.         <NCopy [b + 1,1,1]
  822.         <AlongCurve 0
  823.         <Perpendicular 0
  824.         }
  825. ' Remember b for later
  826. RowOne = b
  827. ' Update Progress Bar
  828.     Progress 50 100
  829. '
  830. ' Draw the 3rd Row of Decking
  831.   ' Draw 1st Piece of Decking for 3rd Row
  832.      >Box
  833.         {
  834.         <PointXYZ [0, IYPhigh + IYJhigh + IYKhigh, 2*IZKdepe + 2*IXZKspc]
  835.         <PointRel [3*IXJcent + IXZJovr, -IYKhigh, IZKdepe]
  836.        }
  837. ' Loop for 3rd Row of Decking
  838. a = 0
  839. b = 0
  840. ted = IXDwide - IXKwide
  841. do while a < ted
  842. ' Draw 2nd Piece of Decking for 3rd Row
  843.      >Box
  844.         {
  845.         <PointXYZ [a + 3*IXJcent + IXZJovr + IXZKspc, IYPhigh + IYJhigh + IYKhigh, 2*IZKdepe + 2*IXZKspc]
  846.         <PointRel [IXKwide, -IYKhigh, IZKdepe]
  847.        }
  848.     if a < IXDwide then
  849.      a = a + IXKwide + IXZKspc
  850.     endif
  851.   b = b + 1
  852. loop
  853. ' >>> Decking and Beams
  854. '
  855.     >SelectLayer
  856.     {
  857.     <Layer 6
  858.     }
  859. ' Set current Material to Oak
  860.     Sys(349) = 14
  861. ' Set current color for Oak Material
  862.     Sys(350) = 255
  863.     Sys(351) = 182
  864.     Sys(352) = 74
  865. ' Apply Current Material and Color to Layers
  866.     >ApplyMaterial
  867.     {
  868.     }
  869.     >ApplyColor
  870.     {
  871.     }
  872. ' >>> Material List, Decking, first row
  873. ' + 1 because we drew a piece of decking outside the loop above first
  874.     att$ = Decking$
  875.     gosub DeckData
  876.         >Array
  877.           {
  878.         <PointXYZ 10, 10, 10
  879.         <NCopy [b + 1,1,1]
  880.         <AlongCurve 0
  881.         <Perpendicular 0
  882.         }
  883. ' Remember b for Later
  884. RowThree = b
  885.      >SelectLayer
  886.     {
  887.     <Layer 6
  888.     }
  889. ' Set the Decking's handle
  890.      >SetHandle
  891.           {
  892.         <PointXYZ [0, IYPhigh, 0]
  893.           }
  894. ' Calculate Number of Portions (The 3 Rows that have Been Drawn = 1 Portion) of Decking Needed for Depth
  895. NumoDckZ = (IZDdeep / (IXZKspc+IZKdepe)) / 3
  896. ' Array the Decking for Depth
  897.      >Array
  898.           {
  899.         <PointXYZ [0, IYPhigh, 3*IZKdepe + 3*IXZKspc]
  900.     ' NumoDckZ + 1 is Neccessary because DesignCAD Arrays with more than one entity only
  901.         <NCopy [NumoDckZ + 1,1,1]
  902.         <AlongCurve 0
  903.         <Perpendicular 0
  904.         }
  905.      >FitToAllWindow
  906.         {
  907.         }
  908. DeckDeep = RowOne + RowTwo + RowThree
  909. ' >>> Material List, Decking, first row
  910. ' # of pieces of decking on all 3 rows added together * array #
  911.     att$ = Decking$
  912.     gosub DeckData
  913.         >Array
  914.           {
  915.         <PointXYZ 10, 10, 10
  916.         <NCopy [NumoDckZ * DeckDeep,1,1]
  917.         <AlongCurve 0
  918.         <Perpendicular 0
  919.         }
  920. '
  921. ' Update Progress Bar
  922.     Progress 60 100
  923. '
  924. ' Turn Edit Current Layer Only Off
  925. Sys(26) = 0
  926. '
  927. ' Deselect everything
  928. Sys(34) = 0
  929. '
  930.   ' Joists go on Layer 5
  931.         SYS(3)=5
  932.         SYS$(93) = "Joists"
  933. ' Slice for Truncating the Corner of Deck
  934. ' Origional Code used X and Z overhang values for slice,
  935. ' New Code uses 1/3 of the Deck Width and Depth
  936. '     >Slice
  937. '        {
  938. '        <Pointxyz [IXDwide - IXDover], 0, [IZDdeep]
  939. '        <Pointxyz [IXDwide], 0, [IZDdeep - IZDover]
  940. '        <Pointxyz [IXDwide], 2, [IZDdeep - IZDover]
  941. '        <Pointxyz [IXDwide + 10], 2, [IZDdeep - IZDover]
  942. '        }
  943. ' Update Progress Bar
  944.     Progress 70 100
  945. '
  946.      >Slice
  947.         {
  948.         <Pointxyz [IXDwide - Ted1], 0, [IZDdeep]
  949.         <Pointxyz [IXDwide], 0, [IZDdeep - Ted2]
  950.         <Pointxyz [IXDwide], 2, [IZDdeep - Ted2]
  951.         <Pointxyz [IXDwide + 10], 2, [IZDdeep - Ted2]
  952.         }
  953. ' Slice the left side of the deck
  954.      >Slice
  955.         {
  956.         <Pointxyz 0, 0, [IZDdeep - Ted2]
  957.         <Pointxyz [Ted1], 0, [IZDdeep]
  958.         <Pointxyz 0, 2, [IZDdeep - Ted2]
  959.         <Pointxyz 0, 2, [IZDdeep + 3]
  960.         }
  961. ' Update Progress Bar
  962.     Progress 80 100
  963. '
  964. ' Slice the Right Side of Deck for Scraps
  965.      >Slice
  966.         {
  967.         <Pointxyz [IXDwide], 0, 0
  968.         <Pointxyz [IXDwide], 0, [IZDdeep]
  969.         <Pointxyz [IXDwide], 2, [IZDdeep]
  970.         <Pointxyz [IXDwide + 10], 2, [IZDdeep]
  971.         }
  972. ' Update Progress Bar
  973.     Progress 90 100
  974. '
  975. ' Slice the Back of Deck for Scraps
  976.      >Slice
  977.         {
  978.         <Pointxyz 0, 0, [IZDdeep]
  979.         <Pointxyz [IXDwide], 0, [IZDdeep]
  980.         <Pointxyz [IXDwide], 2, [IZDdeep]
  981.         <Pointxyz [IXDwide], 2, [IZDdeep + 10]
  982.         }
  983. ' Section to Cap off Slice
  984. '      ps1 = IYDhigh
  985. '      gosub status
  986. '      ps1 = IYBhigh
  987. '      gosub status
  988.      >Wall
  989.         {
  990.     <thick 0.5        
  991.     <Pointxyz [IXDwide - Ted1], [IYPhigh], [IZDdeep]
  992.         <Pointrel [Ted1], [IYJhigh], [- Ted2]
  993.     }
  994. ' Caps off the right slice
  995.      >Wall
  996.         {
  997.     <thick 0.5        
  998.     <Pointxyz [Ted1], [IYPhigh], [IZDdeep]
  999.         <Pointrel [-Ted1], [IYJhigh], [-Ted2]
  1000.     }
  1001. ' Select Layers 4 and 5
  1002. ' Deck Frame and Joists
  1003.     >SelectLayer
  1004.     {
  1005.     <Layer 4
  1006.     <Layer 5
  1007.     }
  1008. ' Set current Material to Walnut
  1009.     Sys(349) = 21
  1010. ' Set current color for Oak Material
  1011.     Sys(350) = 177
  1012.     Sys(351) = 102
  1013.     Sys(352) = 25
  1014. ' Apply Current Material and Color to Layers
  1015.     >ApplyMaterial
  1016.     {
  1017.     }
  1018.     >ApplyColor
  1019.     {
  1020.     }
  1021. ' Slice ALWAYS get's turned around so the slice faces the user
  1022.      >SelectAll
  1023.          {
  1024.           }
  1025.      >SetHandle
  1026.           {
  1027.         <PointXYZ [0, IYPhigh, 0]
  1028.           }
  1029.      >Mirror
  1030.     {
  1031.         <PointXYZ [0, IYPhigh, IZDdeep]
  1032.       <Axis 2
  1033.       <Type 0
  1034.     }
  1035. ' Section to add Post support for each sliced beam
  1036.     ' Hide all Layers up to 12
  1037.         For a = 1 to 12
  1038.             Layer(a) = 0
  1039.         next a
  1040.     ' Make Layer 13 Current
  1041.         Layer(13) = 14
  1042. ' Deck Width / 3
  1043.     Ted1 = IXDwide / 3
  1044. ' Deck Depth / 3
  1045.     Ted2 = IZDdeep / 3
  1046.      >Line
  1047.     {
  1048.     <PointXYZ [IXDwide - Ted1, 0, 0]
  1049.     <PointXYZ [IXDwide, 0, 0 + Ted2]
  1050.     }
  1051. ' Left slice line
  1052.      >Line
  1053.     {
  1054.     <PointXYZ [0, 0, 0 + Ted2]
  1055.     <PointXYZ [Ted1, 0, 0]
  1056.     }
  1057.     ' Variables used in loop
  1058.         CurCount = IZDover 
  1059.         MaxCount = Ted2
  1060.     b = 1
  1061.     Do while CurCount <= MaxCount
  1062.     ' Make Layer 13 Current
  1063.         Layer(13) = 14
  1064.     ' Draw First Guide Line
  1065.         >Line
  1066.         {
  1067.         <PointXYZ [0, 0, CurCount]
  1068.         <PointXYZ [IXDwide, 0, CurCount]
  1069.         }
  1070.     ' Select Objects when Created
  1071.         Sys(242) = 1
  1072.     ' Draw a pointmark at intersection
  1073.         >PointMark
  1074.         {
  1075.         <Type 3
  1076.         <Size 4
  1077.         <Int2 0, 0, [CurCount], [IXDwide - Ted1], 0, 0     
  1078.         }
  1079.     ' Get the Entity ID of the pointmark
  1080.         getselect 1, a
  1081.     ' Load the pointmark into memory
  1082.         entity a
  1083.     ' Get the XYZ value of the pointmark
  1084.         for j = 1 to sys(1)
  1085.               pointval jx jy jz j
  1086.         next j
  1087.     '
  1088.     ' Take about a foot away for safety
  1089.         jx = jx - 16
  1090.     ' Make Layer 14 Current
  1091.         Layer(14) = 14
  1092.           SYS$(93) = "Support Posts"    
  1093.     ' Draw Support Post
  1094.         >Box
  1095.               {
  1096.              <PointXYZ [jx+IXPwide], 0, [jz+IZPhdeep]
  1097.               <Pointrel [-IXPwide], [IYPhigh], [-IXPwide]
  1098.               }
  1099.     ' Increment Counters
  1100.         CurCount = CurCount + IZBdeep
  1101.         b = b + 1
  1102.     Loop    
  1103.     ' Show all Layers up to 12
  1104.         For a = 1 to 12
  1105.             Layer(a) = 6
  1106.         next a
  1107.     ' Clean up Layer 13
  1108.         >SelectLayer
  1109.         {
  1110.         <Layer 13
  1111.         }
  1112.     ' Delete contents of that layer
  1113.         >SelectDelete
  1114.         {
  1115.         }
  1116.     ' Select Layer 14
  1117.         >SelectLayer
  1118.         {
  1119.         <Layer 14
  1120.         }
  1121.     ' Set it's handle
  1122.         >SetHandle
  1123.         {
  1124.         <Pointxyz [IXDwide / 2], 0, 0
  1125.         <Pointxyz [IXDwide / 2], 0, 0
  1126.         <Pointxyz [IXDwide / 2], 0, 0
  1127.         }
  1128.     ' Mirror Support Posts
  1129.         >Mirror
  1130.         {
  1131.         <axis 0    
  1132.         <type 1
  1133.         <Pointxyz [IXDwide / 2], 0, 0
  1134.         }
  1135.     ' Turn Select Object when Created Off
  1136.         Sys(242) = 0
  1137.     ' Show entire deck
  1138.         >FitToAllWindow
  1139.             {
  1140.             }
  1141.     ' De-select the mirrored support posts
  1142.         >PointSelect
  1143.         {
  1144.         <Type 0
  1145.         <pointxyz -199, -199, -199
  1146.         }
  1147. ' If user chose Deck Type that needs slice running on the 
  1148. ' left side . . .
  1149. If Dvalue = 1 Then
  1150.      >FitToAllWindow
  1151.         {
  1152.        }
  1153.    Else
  1154.      >SelectAll
  1155.     {
  1156.           }
  1157.      >SetHandle
  1158.           {
  1159.         <PointXYZ [0, IYPhigh, 0]
  1160.           }
  1161.      >Mirror
  1162.     {
  1163.         <PointXYZ [0, IYPhigh, IZDdeep]
  1164.     <Axis 0
  1165.     <Type 0
  1166.     }
  1167. ' Deselect everything
  1168. Sys(34) = 0
  1169.      >FitToAllWindow
  1170.         {
  1171.        }
  1172.  
  1173.  
  1174.  
  1175. End If
  1176. ' Turn off Silent Mode
  1177.     Sys(36) = 0           
  1178. >PointSelect
  1179.     {
  1180.     <PointXYZ -34,-43,-32
  1181.     }
  1182. '
  1183. ' Deselect everything
  1184. Sys(34) = 0
  1185. ' Update Progress Bar
  1186.     Progress 99 100
  1187. '
  1188. ' Set Units back to feet so when users dimension the deck it comes up in feet, not inches
  1189. ' Get Min and Max X Values for drawing
  1190.     MinX = Sys(120)
  1191.     MaxX = Sys(122)
  1192. ' Use Units command to change deck drawing scale
  1193. ' Deck Inches / 12 to get # of feet to set units to
  1194.     Ted = IXDwide / 12
  1195.     >Units
  1196.     {
  1197.     <pointxyz [MinX], 0, 0
  1198.     <pointxyz [MaxX], 0, 0
  1199.     <length [FXDwide]
  1200.     }
  1201. if Shade = 0 then
  1202.     for a = 0 to 3
  1203.         Sys(71) = a
  1204.         Sys(2) = 0
  1205.     next a
  1206. endif
  1207. if Shade = 1 then
  1208.     for a = 0 to 3
  1209.         Sys(71) = a
  1210.         Sys(2) = 1
  1211.     next a
  1212. endif
  1213. if Shade = 2 then
  1214. >ShadeView
  1215. {
  1216.     <ShowLine 0
  1217.     <ShowArrow 1
  1218.     <ShowDim 1
  1219.     <ShowText 0
  1220. }
  1221. endif
  1222.     Sys(71) = 1
  1223. ' Set current color back to black
  1224.     Sys(350) = 0
  1225.     Sys(351) = 0
  1226.     Sys(352) = 0
  1227. ' Apply Current Color 
  1228.     >ApplyColor
  1229.     {
  1230.     }
  1231. ' Turn off Progress Bar
  1232.     Progress 0
  1233.     Layer(15) = 0                ' Turn off Layer 15
  1234. '
  1235. ' End of Program
  1236. ' Do NOT display Attribs
  1237.     Sys(21) = 0
  1238. ' Set Dimension Format to fractional
  1239.     Sys(101) = 3
  1240. ' Set Text Size large for users
  1241.     if FXDwide > IZDdeep then
  1242.         KDW6 = FXDwide / 50
  1243.     else
  1244.         KDW6 = FZDdeep / 50
  1245.     end if
  1246.     Sys(438) = KDW6
  1247. KDW7 = KDW6 *.50
  1248. ' Make a Dimension with the NULL paramater to set Dimension settings which don't 
  1249. ' have a SYS function, and which use cryptic # values in the INI file.
  1250. ' Pass a NULL to not actually draw a dimension, but it's settings 
  1251. ' remain sticky for each dimension you place in that session of Dcad.
  1252. '
  1253. >Dimension
  1254. {
  1255.   <Color 0,0,0
  1256.   <Layer 1
  1257.   <PointXYZ -16.8023,-2.2529,0.0000
  1258.   <PointXYZ 9.1748,-5.0914,0.0000
  1259.   <PointXYZ 6.8080,7.6270,0.0000
  1260.   <Axis 0
  1261.   <Orientation 0
  1262.   <Precision 3
  1263.   <Location 0
  1264.   <ToleranceType 0
  1265.   <ToleranceSize 0.5000
  1266.   <ToleranceLow -0.01
  1267.   <ToleranceHigh +0.01
  1268.   <Tolerance 0.01
  1269.   <Suffix "0"
  1270.   <Prefix "0"
  1271.   <Type 0
  1272.   <Size [KDW7]
  1273.   <Fix 0
  1274.   <Gap 1.0000
  1275.   <Length 2.0000
  1276.   <OverShoot 0.5000
  1277.   <LinePosition 0
  1278.   <NULL
  1279.   }
  1280. '
  1281. End
  1282. '
  1283. ' Routine to display values on the Status Bar
  1284. Status:
  1285.   ps2 = ps1 / 12
  1286.   ps3 = ps1 * 12
  1287. ' Display Results
  1288.   ps$ = " Value Passed = ",ps1,"     Value Divided by 12 = ",ps2,"      Value Multiplied by 12 = ",ps3
  1289.   Message ps$
  1290. Return
  1291. '
  1292. ' Routine to add Deck Data Items to the drawing
  1293. DeckData:
  1294. ' Turn Select Object when Created Off
  1295.     Sys(242) = 1
  1296. ' Save Current Layer
  1297.     CurLay = SYS(3)
  1298. ' Set Current Layer to 15
  1299.     SYS(3) = 15
  1300.         SYS$(93) = "Attributes"
  1301. ' Write Attribute
  1302.     >Attribute
  1303.     {
  1304.       <Color 0,0,0
  1305.       <PointXYZ 10, 10, 10
  1306.       <Style 0
  1307.       <Justification 0
  1308.       <Size .005
  1309.       <Font "Arial"
  1310.       <Text [att$]
  1311.     }
  1312. ' Set Layer's Back
  1313.     SYS(3) = CurLay
  1314. ' Turn Select Object when Created Off
  1315.     Sys(242) = 0
  1316. Return