home *** CD-ROM | disk | FTP | other *** search
/ Corel Draw 7 / CD7_CAD.ISO / cad / model1.csc < prev    next >
Encoding:
Text File  |  1996-10-28  |  8.7 KB  |  265 lines

  1. 'This script gives a demonstration of the construction of a WHEEL MODEL using basic CorelCAD commands
  2.  
  3. '***********D*************************************************************************************************
  4. '***************************A*********************************************************************************
  5. '*****************************************************V*******************************************************
  6. '******************************************************************************E******************************
  7. REM ⌐ 1996 Corel Corporation. All rights reserved.
  8. '************************************************************************************************************
  9.  
  10.  
  11. REM Declare Variables
  12. Global Title as string
  13.  
  14. Rem Set Variable
  15. Title$ = "CorelCAD: Wheel Construction Demo"
  16.  
  17. WITHOBJECT "CorelCAD.Automation.1"
  18.  
  19.     .filenew
  20.     
  21.     string1$ = "This script will show you the construction of a wheel model step by step."
  22.     string2$ = "For more information on the features used in the demonstration consult CorelCAD's On-line Help."
  23.     BEGIN DIALOG DispMessage1 25, 70, 316, 70,Title$
  24.         TEXT  4, 2, 310, 17, String1$
  25.         TEXT  4, 20, 310, 19, String2$
  26.         TEXT  6, 46, 170, 13, "Click NEXT to proceed or CANCEL to exit the Script."
  27.         PUSHBUTTON  198, 44, 40, 16, "Next >>>"
  28.         CANCELBUTTON  240, 44, 40, 16
  29.     END DIALOG
  30.  
  31.     Return% = DIALOG (DispMessage1)
  32.     if Return = 2 then STOP
  33.  
  34.     string1$ = "First, two construction CIRCLES will be drawn."
  35.     string2$ = "They will then both be EXTRUDED to solids."    
  36.     BEGIN DIALOG DispMessage2 25, 70, 316, 70,Title$
  37.         TEXT  4, 2, 310, 17, String1$
  38.         TEXT  4, 20, 310, 19, String2$
  39.         TEXT  6, 46, 170, 13, "Click NEXT to proceed or CANCEL to exit the Script."
  40.         PUSHBUTTON  198, 44, 40, 16, "Next >>>"
  41.         CANCELBUTTON  240, 44, 40, 16
  42.     END DIALOG
  43.  
  44.     Return% = DIALOG (DispMessage2)
  45.     if Return = 2 then STOP
  46.     
  47.     .CircleRadius -1, 0, 0, 0, 55, 0, 0
  48.     .ZoomToAll 
  49.     .CircleRadius -1, 0, 0, 0, 35, 0, 0
  50.     .SelectPointAt -50.5416, 18.0458, 0, 0
  51.     .StartAddCmdPoint 2
  52.     .AddCmdPoint -45.0157, -10.8285, 0
  53.     .AddCmdPoint -45.0157, -10.8285, 12
  54.     .EndAddCmdPoint 
  55.     .Extrude 0
  56.     .SelectPointAt -16.4731, -38.8804, 11.092, 0
  57.     .StartAddCmdPoint 2
  58.     .AddCmdPoint -42.1412, -4.26234, 11.092
  59.     .AddCmdPoint -42.1412, -4.26234, 30.0
  60.     .EndAddCmdPoint 
  61.     .Extrude 0
  62.  
  63.     string1$ = "Now the inner cylinder will be chopped into a quarter cylinder."
  64.     string2$ = "We will use BOOLEAN SUBTRACT to do this."
  65.     BEGIN DIALOG DispMessage3 25, 70, 316, 70,Title$
  66.         TEXT  4, 2, 310, 17, String1$
  67.         TEXT  4, 20, 310, 19, String2$
  68.         TEXT  6, 46, 170, 13, "Click NEXT to proceed or CANCEL to exit the Script."
  69.         PUSHBUTTON  198, 44, 40, 16, "Next >>>"
  70.         CANCELBUTTON  240, 44, 40, 16
  71.     END DIALOG
  72.  
  73.     Return% = DIALOG (DispMessage3)
  74.     if Return = 2 then STOP
  75.  
  76.     .SelectPointAt -12.0632, -4.08458, 31.6914, 0
  77.     .SelectPointAt -11.8953, -4.96388, 31.6914, 0
  78.     .SelectPointAt -6.2062, -2.5064, 31.6914, 0
  79.     .Box -1, 0, 0, 0, 49.4965, -56.7232, 40.955
  80.     .ZoomOut 
  81.     .ZoomOut 
  82.     .Box -1, 0, 0, 0, 64.3167, 57.6374, 40.955
  83.     .Box -1, 0, 0, 0, -48.6073, 57.7111, 40.955
  84.     .SelectPointAt -77.4771, 31.8843, 40.955, 0
  85.  
  86.     string1$ = "These BOXES have been constructed to be subtracted from the inner cylinder."
  87.     string2$ = ""
  88.     BEGIN DIALOG DispMessage4 25, 70, 316, 70,Title$
  89.         TEXT  4, 2, 310, 17, String1$
  90.         TEXT  4, 20, 310, 19, String2$
  91.         TEXT  6, 46, 170, 13, "Click NEXT to proceed or CANCEL to exit the Script."
  92.         PUSHBUTTON  198, 44, 40, 16, "Next >>>"
  93.         CANCELBUTTON  240, 44, 40, 16
  94.     END DIALOG
  95.  
  96.     Return% = DIALOG (DispMessage4)
  97.     if Return = 2 then STOP
  98.  
  99.     .SetPointXYZ -7.15804, -51.1839, 40.955
  100.     .SetPointXYZ -48.2572, 28.8391, 40.955
  101.     .SetPointXYZ 8.68856, 56.9014, 40.955
  102.     .SetPointXYZ 49.6661, -57.8111, 40.955
  103.     .SolidSubtract 
  104.     .SelectPointAt 11.1676, -32.2339, 40.955, 0
  105.     .Move 0, 0, 0, 0, 0, -5, -5, 0
  106.  
  107.     string1$ = "Now a CIRCULAR ARRAY will place 4 copies around a user specified axis."
  108.     string2$ = "A BOOLEAN SUBTRACT will give us a starting object."
  109.     BEGIN DIALOG DispMessage5 25, 70, 316, 70,Title$
  110.         TEXT  4, 2, 310, 17, String1$
  111.         TEXT  4, 20, 310, 19, String2$
  112.         TEXT  6, 46, 170, 13, "Click NEXT to proceed or CANCEL to exit the Script."
  113.         PUSHBUTTON  198, 44, 40, 16, "Next >>>"
  114.         CANCELBUTTON  240, 44, 40, 16
  115.     END DIALOG
  116.  
  117.     Return% = DIALOG (DispMessage5)
  118.     if Return = 2 then STOP
  119.  
  120.     .CircularArray 4, 360, -1, 0, 0, 0, 0, 0, 5, 0
  121.     .SetPointXYZ -52.3332, -14.4441, 0
  122.     .SetPointXYZ -42.8411, -3.95777, 0
  123.     .SetPointXYZ -40.6392, 27.5305, 0
  124.     .SetPointXYZ 4.62838, 25.2103, 0
  125.     .SetPointXYZ 17.0254, -13.5489, 0
  126.     .SolidSubtract 
  127.  
  128.     string1$ = "Now, a PLANE will be drawn to construct a tooth."
  129.     string2$ = ""
  130.     BEGIN DIALOG DispMessage6 25, 70, 316, 70,Title$
  131.         TEXT  4, 2, 310, 17, String1$
  132.         TEXT  4, 20, 310, 19, String2$
  133.         TEXT  6, 46, 170, 13, "Click NEXT to proceed or CANCEL to exit the Script."
  134.         PUSHBUTTON  198, 44, 40, 16, "Next >>>"
  135.         CANCELBUTTON  240, 44, 40, 16
  136.     END DIALOG
  137.  
  138.     Return% = DIALOG (DispMessage6)
  139.     if Return = 2 then STOP
  140.  
  141.     .SetPointXYZ 55, 0, 0
  142.     .SetPointXYZ 53.9147, 9.36085, 0
  143.     .SetPointXYZ 60.2683, 10.464, 0
  144.     .SetPointXYZ 60.9163, 15.579, 0
  145.     .SetPointXYZ 65.49, 11.3706, 0
  146.     .SetPointXYZ 64.297, 7.9246, 0
  147.     .SetPointXYZ 71.7344, 5.6733, 0
  148.     .SetPointXYZ 65.6492, 3.422, 0
  149.     .SetPointXYZ 67.903, -0.178138, 0
  150.     .SetPointXYZ 65.1985, -5.35809, 0
  151.     .SetPointXYZ 63.8486, -0.167501, 0
  152.     .Plane 0
  153.     .zoomtoselected
  154.  
  155.     string1$ = "Various FILLETS can be performed to smooth out the corners of the plane."
  156.     string2$ = ""
  157.     BEGIN DIALOG DispMessage7 25, 70, 316, 70,Title$
  158.         TEXT  4, 2, 310, 17, String1$
  159.         TEXT  4, 20, 310, 19, String2$
  160.         TEXT  6, 46, 170, 13, "Click NEXT to proceed or CANCEL to exit the Script."
  161.         PUSHBUTTON  198, 44, 40, 16, "Next >>>"
  162.         CANCELBUTTON  240, 44, 40, 16
  163.     END DIALOG
  164.  
  165.     Return% = DIALOG (DispMessage7)
  166.     if Return = 2 then STOP
  167.  
  168.     .Fillet 3, 61.865, -0.138761, 0, 64.4004, -2.46746, 0
  169.     .Fillet 3, 66.8369, -2.36125, 0, 66.6132, 1.91859, 0
  170.     .Fillet 3, 64.8088, 9.39469, 0, 64.7222, 12.033, 0
  171.     .Fillet 3, 60.4297, 11.6804, 0, 59.6432, 10.2705, 0
  172.     .Fillet 1, 60.8131, 14.6728, 0, 61.3081, 15.1182, 0
  173.     .Fillet 1, 64.7087, 8.98159, 0, 65.0123, 7.77341, 0
  174.     .Fillet 1, 68.2821, 6.7694, 0, 69.3439, 4.73241, 0
  175.     .Fillet 1, 66.416, 3.65426, 0, 66.1921, 2.62706, 0
  176.     .Fillet 1, 65.7152, -4.31112, 0, 64.8713, -4.22409, 0
  177.  
  178.     string1$ = "Another EXTRUDE will give us our tooth."
  179.     string2$ = ""
  180.     BEGIN DIALOG DispMessage8 25, 70, 316, 70,Title$
  181.         TEXT  4, 2, 310, 17, String1$
  182.         TEXT  4, 20, 310, 19, String2$
  183.         TEXT  6, 46, 170, 13, "Click NEXT to proceed or CANCEL to exit the Script."
  184.         PUSHBUTTON  198, 44, 40, 16, "Next >>>"
  185.         CANCELBUTTON  240, 44, 40, 16
  186.     END DIALOG
  187.  
  188.     Return% = DIALOG (DispMessage8)
  189.     if Return = 2 then STOP
  190.  
  191.     .SelectPointAt 55,0,0
  192.     .StartAddCmdPoint 2
  193.     .AddCmdPoint 55, 0, 0
  194.     .AddCmdPoint 55,0,12
  195.     .EndAddCmdPoint 
  196.     .Extrude 0
  197.     .zoomtoselected
  198.     .SelectPointAt 55,0,0
  199.     .Move 0, 0, 55, 0, 0, 51, 0, 0
  200.  
  201.     string1$ = "And another CIRCULAR ARRAY will give us many teeth."
  202.     string2$ = ""
  203.     BEGIN DIALOG DispMessage9 25, 70, 316, 70,Title$
  204.         TEXT  4, 2, 310, 17, String1$
  205.         TEXT  4, 20, 310, 19, String2$
  206.         TEXT  6, 46, 170, 13, "Click NEXT to proceed or CANCEL to exit the Script."
  207.         PUSHBUTTON  198, 44, 40, 16, "Next >>>"
  208.         CANCELBUTTON  240, 44, 40, 16
  209.     END DIALOG
  210.  
  211.     Return% = DIALOG (DispMessage9)
  212.     if Return = 2 then STOP
  213.  
  214.     .CircularArray 18, 360, -1, 0, 0, 0, 0, 0, 2, 0
  215.     .SelectAll
  216.     .zoomtoselected
  217.  
  218.     string1$ = "A BOOLEAN ADD will combine all of the individual solids into one solid."
  219.     string2$ = ""
  220.     BEGIN DIALOG DispMessage10 25, 70, 316, 70,Title$
  221.         TEXT  4, 2, 310, 17, String1$
  222.         TEXT  4, 20, 310, 19, String2$
  223.         TEXT  6, 46, 170, 13, "Click NEXT to proceed or CANCEL to exit the Script."
  224.         PUSHBUTTON  198, 44, 40, 16, "Next >>>"
  225.         CANCELBUTTON  240, 44, 40, 16
  226.     END DIALOG
  227.  
  228.     Return% = DIALOG (DispMessage10)
  229.     if Return = 2 then STOP
  230.  
  231.     .SolidAdd 
  232.  
  233.     string1$ = "A MATERIAL will now be applied."
  234.     string2$ = "This will take a moment."
  235.     BEGIN DIALOG DispMessage11 25, 70, 316, 70,Title$
  236.         TEXT  4, 2, 310, 17, String1$
  237.         TEXT  4, 20, 310, 19, String2$
  238.         TEXT  6, 46, 170, 13, "Click NEXT to proceed or CANCEL to exit the Script."
  239.         PUSHBUTTON  198, 44, 40, 16, "Next >>>"
  240.         CANCELBUTTON  240, 44, 40, 16
  241.     END DIALOG
  242.  
  243.     Return% = DIALOG (DispMessage11)
  244.     if Return = 2 then STOP
  245.  
  246.     .selectall
  247.     .ApplyMaterial "Jewel", "Mother of Pearl"
  248.     .ShadeEntireView 0, 0, 3, 0
  249.  
  250. beep
  251. BEGIN DIALOG endn 25, 70, 154, 65,Title$
  252.     TEXT  29, 14, 98, 8, "The demonstration is complete."
  253.     PUSHBUTTON  61, 34, 40, 16, "End"
  254. END DIALOG
  255.  
  256.     Return% = DIALOG (endn)
  257.     if Return = 2 then STOP
  258.  
  259.  
  260. END WITHOBJECT
  261.  
  262.  
  263. '***************************************************************************************************************************
  264.  
  265.