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

  1. 'This script will demonstrate CorelCAD's OLE compatibility with CorelDRAW 7.0, using 3D ClipART
  2.  
  3. '************************************************************************************************************
  4. '************************************************************************************************************
  5. '************************************************************************************************************
  6. '************************************************************************************************************
  7. REM ⌐ 1996 Corel Corporation. All rights reserved.
  8. '************************************************************************************************************
  9.  
  10. REM Declare Subroutines
  11.  
  12.  
  13. REM Declare Variables
  14. Global Title as string
  15.  
  16. Rem Set Variable
  17. Title$ = "CorelCAD: Clipart demonstration"
  18.  
  19. DIM SymbolPicked%
  20. DIM ShadePicked%
  21. DIM ProjectionPicked%    
  22. DIM SymbolNames$(5)
  23. DIM ShadeType$(7)
  24. DIM ProjectionType$(3)
  25.  
  26. SymbolPicked = 1                ' default setting for list selection
  27. SymbolNames(1) = "Airplane"
  28. SymbolNames(2) = "Gazebo"
  29. SymbolNames(3) = "Table Set"
  30. SymbolNames(4) = "Truck"
  31. SymbolNames(5) = "Dog"
  32.  
  33. ShadePicked = 2                ' default setting for list selection
  34. ShadeType(1) = "Flat Shading"
  35. ShadeType(2) = "Gouraud Shading"
  36. ShadeType(3) = "Phong Shading"
  37. ShadeType(4) = "Preview"
  38. ShadeType(5) = "Full Render"
  39. ShadeType(6) = "Ray Traced Preview"
  40. ShadeType(7) = "Ray Traced Render"
  41.  
  42. ProjectionPicked = 1
  43. ProjectionType(1) = "Perspective View"
  44. ProjectionType(2) = "Top View"
  45. ProjectionType(3) = "Front View"
  46. '************************************************************************************************************
  47. '************************************************************************************************************
  48. '************************************************************************************************************
  49. WITHOBJECT "CorelCAD.Automation.1"
  50. .filenew
  51.  
  52.  
  53.     Message "CorelDRAW 7.0 must be installed for this script to work."
  54.  
  55.  
  56.     String1$ = "This script EXPORTS a RENDERED clipart object from CorelCAD to CorelDRAW 7.0."
  57.     String2$ = "This script will generate a bitmap file (*.BMP) which will be IMPORTED into CorelDRAW 7.0."
  58. BEGIN DIALOG DispMessage1 25, 70, 316, 70,Title$
  59.     TEXT  4, 2, 310, 17, String1$
  60.     TEXT  4, 20, 310, 19, String2$
  61.     TEXT  6, 46, 170, 13, "Click NEXT to proceed or CANCEL to exit the Script."
  62.     PUSHBUTTON  198, 44, 40, 16, "Next >>>"
  63.     CANCELBUTTON  240, 44, 40, 16
  64. END DIALOG
  65.  
  66.     Return% = DIALOG (DispMessage1)
  67.     if Return = 2 then STOP
  68.  
  69.  
  70. '************************************************************************************************************
  71. ' This next section lets the user decide which clipart sybol he/she wants to work with
  72.  
  73. BEGIN DIALOG SymbolDia 25, 70, 113, 91, "CHOOSE A SYMBOL"
  74.     LISTBOX  14, 19, 82, 52, SymbolNames$, SymbolPicked%
  75.     PUSHBUTTON  18, 75, 36, 13, "Next >>>"
  76.     CANCELBUTTON  55, 75, 36, 13
  77.     TEXT  8, 0, 98, 16, "Choose a clipart symbol to open into CorelCAD."
  78. END DIALOG
  79. Return = DIALOG(SymbolDia)
  80. if Return = 2 then STOP
  81. '************************************************************************************************************
  82. '************************************************************************************************************
  83. '************************************************************************************************************
  84. 'This next section imports and renders the selected clip art
  85. ' Clip art files found in the program directory    
  86.  
  87.  
  88.     SELECT CASE SymbolPicked%    
  89.         CASE 1
  90.             .fileopen "..\cad\Plane.ccd"
  91.         CASE 2
  92.             .fileopen    "..\cad\Gazebo.ccd"
  93.         CASE 3
  94.             .fileopen    "..\cad\Table.ccd"
  95.         CASE 4
  96.             .fileopen "..\cad\Truck.ccd"
  97.         CASE 5
  98.             .fileopen "..\cad\Dog.ccd"
  99.     END SELECT
  100.         .zoomtoall
  101. '************************************************************************************************************
  102. BEGIN DIALOG Projection 25, 70, 127, 78, "Projection Type"
  103.     PUSHBUTTON  18, 59, 44, 14, "Next >>>"
  104.     CANCELBUTTON  62, 59, 44, 14
  105.     TEXT  8, 3, 119, 9, "Select projection (view)"
  106.     LISTBOX  26, 16, 72, 38, ProjectionType$, ProjectionPicked%
  107. END DIALOG
  108.     return% = DIALOG(Projection)    
  109.     if return = 2 then STOP
  110.  
  111.     IF NOT(ProjectionPicked = 1) then
  112.         .fileclose
  113.         SELECT CASE SymbolPicked
  114.             CASE 1
  115.                 IF ProjectionPicked = 2 then .fileopen "..\cad\PlaneTopView.ccd"
  116.                 IF ProjectionPicked = 3 then .fileopen "..\cad\PlaneFrontView.ccd"                    
  117.             CASE 2
  118.                 IF ProjectionPicked = 2 then .fileopen "..\cad\GazeboTopView.ccd"
  119.                 IF ProjectionPicked = 3 then .fileopen "..\cad\GazeboFrontView.ccd"                    
  120.             CASE 3
  121.                 IF ProjectionPicked = 2 then .fileopen "..\cad\TableTopView.ccd"
  122.                 IF ProjectionPicked = 3 then .fileopen "..\cad\TableFrontView.ccd"                    
  123.             CASE 4
  124.                 IF ProjectionPicked = 2 then .fileopen "..\cad\TruckTopView.ccd"
  125.                 IF ProjectionPicked = 3 then .fileopen "..\cad\TruckFrontView.ccd"                    
  126.             CASE 5
  127.                 IF ProjectionPicked = 2 then .fileopen "..\cad\DogTopView.ccd"
  128.                 IF ProjectionPicked = 3 then .fileopen "..\cad\DogFrontView.ccd"                    
  129.         END SELECT
  130.         .zoomtoall
  131.     END IF
  132. '************************************************************************************************************
  133.                         ' This next section lets the user decide on a rendering quality
  134. BEGIN DIALOG Shade 25, 70, 126, 139, "Rendering Quality"
  135.     PUSHBUTTON  17, 116, 44, 15, "Next >>>"
  136.     CANCELBUTTON  61, 116, 44, 15
  137.     TEXT  8, 3, 118, 9, "Select Render Quality:"
  138.     LISTBOX  26, 14, 72, 62, ShadeType$, ShadePicked%
  139.     TEXT  12, 80, 106, 33, "The RENDER types are listed in increasing RENDER quality. A high quality RENDER may take a moment."
  140. END DIALOG
  141.     Return = DIALOG(Shade)    'Runs the dialog box
  142.     If return = 2 then stop        'If the user presses ESC, cancels the script
  143.  
  144.     ShadePicked = ShadePicked - 1
  145.     .ShadeEntireView -1,-1,ShadePicked,-1
  146. '************************************************************************************************************
  147.     
  148.     String1$ = "The bitmap file will now be EXPORTED from CorelCAD and IMPORTED into CorelDRAW 7.0."
  149.     String2$ = "This may take a few moments."
  150. BEGIN DIALOG DispMessage2 25, 70, 316, 70,Title$
  151.     TEXT  4, 2, 310, 17, String1$
  152.     TEXT  4, 20, 310, 19, String2$
  153.     TEXT  6, 46, 170, 13, "Click NEXT to proceed or CANCEL to exit the Script."
  154.     PUSHBUTTON  198, 44, 40, 16, "Next >>>"
  155.     CANCELBUTTON  240, 44, 40, 16
  156. END DIALOG
  157.  
  158.     Return% = DIALOG (DispMessage2)
  159.     if Return = 2 then STOP
  160.  
  161.  
  162.     
  163.     .FileExport "c:\TempBit.BMP", 769, 1500,1600, 300, 300, 4
  164. END WITHOBJECT
  165.  
  166. WITHOBJECT "CorelDraw.Automation.7"
  167.  
  168.     .filenew
  169.     .setvisible -1    
  170.     .FileImport "c:\TempBit.BMP"
  171.  
  172. beep
  173. BEGIN DIALOG DispMessage3 25, 70, 154, 65,Title$
  174.     TEXT  29, 14, 98, 8, "The demonstration is complete."
  175.     PUSHBUTTON  61, 34, 40, 16, "End"
  176. END DIALOG
  177.  
  178.     Return% = DIALOG (DispMessage3)
  179.     if Return = 2 then STOP
  180.  
  181.  
  182.  
  183. END WITHOBJECT
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.