home *** CD-ROM | disk | FTP | other *** search
- 'This script will demonstrate CorelCAD's OLE compatibility with CorelDRAW 7.0, using 3D ClipART
-
- '************************************************************************************************************
- '************************************************************************************************************
- '************************************************************************************************************
- '************************************************************************************************************
- REM ⌐ 1996 Corel Corporation. All rights reserved.
- '************************************************************************************************************
-
- REM Declare Subroutines
-
-
- REM Declare Variables
- Global Title as string
-
- Rem Set Variable
- Title$ = "CorelCAD: Clipart demonstration"
-
- DIM SymbolPicked%
- DIM ShadePicked%
- DIM ProjectionPicked%
- DIM SymbolNames$(5)
- DIM ShadeType$(7)
- DIM ProjectionType$(3)
-
- SymbolPicked = 1 ' default setting for list selection
- SymbolNames(1) = "Airplane"
- SymbolNames(2) = "Gazebo"
- SymbolNames(3) = "Table Set"
- SymbolNames(4) = "Truck"
- SymbolNames(5) = "Dog"
-
- ShadePicked = 2 ' default setting for list selection
- ShadeType(1) = "Flat Shading"
- ShadeType(2) = "Gouraud Shading"
- ShadeType(3) = "Phong Shading"
- ShadeType(4) = "Preview"
- ShadeType(5) = "Full Render"
- ShadeType(6) = "Ray Traced Preview"
- ShadeType(7) = "Ray Traced Render"
-
- ProjectionPicked = 1
- ProjectionType(1) = "Perspective View"
- ProjectionType(2) = "Top View"
- ProjectionType(3) = "Front View"
- '************************************************************************************************************
- '************************************************************************************************************
- '************************************************************************************************************
- WITHOBJECT "CorelCAD.Automation.1"
- .filenew
-
-
- Message "CorelDRAW 7.0 must be installed for this script to work."
-
-
- String1$ = "This script EXPORTS a RENDERED clipart object from CorelCAD to CorelDRAW 7.0."
- String2$ = "This script will generate a bitmap file (*.BMP) which will be IMPORTED into CorelDRAW 7.0."
- BEGIN DIALOG DispMessage1 25, 70, 316, 70,Title$
- TEXT 4, 2, 310, 17, String1$
- TEXT 4, 20, 310, 19, String2$
- TEXT 6, 46, 170, 13, "Click NEXT to proceed or CANCEL to exit the Script."
- PUSHBUTTON 198, 44, 40, 16, "Next >>>"
- CANCELBUTTON 240, 44, 40, 16
- END DIALOG
-
- Return% = DIALOG (DispMessage1)
- if Return = 2 then STOP
-
-
- '************************************************************************************************************
- ' This next section lets the user decide which clipart sybol he/she wants to work with
-
- BEGIN DIALOG SymbolDia 25, 70, 113, 91, "CHOOSE A SYMBOL"
- LISTBOX 14, 19, 82, 52, SymbolNames$, SymbolPicked%
- PUSHBUTTON 18, 75, 36, 13, "Next >>>"
- CANCELBUTTON 55, 75, 36, 13
- TEXT 8, 0, 98, 16, "Choose a clipart symbol to open into CorelCAD."
- END DIALOG
- Return = DIALOG(SymbolDia)
- if Return = 2 then STOP
- '************************************************************************************************************
- '************************************************************************************************************
- '************************************************************************************************************
- 'This next section imports and renders the selected clip art
- ' Clip art files found in the program directory
-
-
- SELECT CASE SymbolPicked%
- CASE 1
- .fileopen "..\cad\Plane.ccd"
- CASE 2
- .fileopen "..\cad\Gazebo.ccd"
- CASE 3
- .fileopen "..\cad\Table.ccd"
- CASE 4
- .fileopen "..\cad\Truck.ccd"
- CASE 5
- .fileopen "..\cad\Dog.ccd"
- END SELECT
- .zoomtoall
- '************************************************************************************************************
- BEGIN DIALOG Projection 25, 70, 127, 78, "Projection Type"
- PUSHBUTTON 18, 59, 44, 14, "Next >>>"
- CANCELBUTTON 62, 59, 44, 14
- TEXT 8, 3, 119, 9, "Select projection (view)"
- LISTBOX 26, 16, 72, 38, ProjectionType$, ProjectionPicked%
- END DIALOG
- return% = DIALOG(Projection)
- if return = 2 then STOP
-
- IF NOT(ProjectionPicked = 1) then
- .fileclose
- SELECT CASE SymbolPicked
- CASE 1
- IF ProjectionPicked = 2 then .fileopen "..\cad\PlaneTopView.ccd"
- IF ProjectionPicked = 3 then .fileopen "..\cad\PlaneFrontView.ccd"
- CASE 2
- IF ProjectionPicked = 2 then .fileopen "..\cad\GazeboTopView.ccd"
- IF ProjectionPicked = 3 then .fileopen "..\cad\GazeboFrontView.ccd"
- CASE 3
- IF ProjectionPicked = 2 then .fileopen "..\cad\TableTopView.ccd"
- IF ProjectionPicked = 3 then .fileopen "..\cad\TableFrontView.ccd"
- CASE 4
- IF ProjectionPicked = 2 then .fileopen "..\cad\TruckTopView.ccd"
- IF ProjectionPicked = 3 then .fileopen "..\cad\TruckFrontView.ccd"
- CASE 5
- IF ProjectionPicked = 2 then .fileopen "..\cad\DogTopView.ccd"
- IF ProjectionPicked = 3 then .fileopen "..\cad\DogFrontView.ccd"
- END SELECT
- .zoomtoall
- END IF
- '************************************************************************************************************
- ' This next section lets the user decide on a rendering quality
- BEGIN DIALOG Shade 25, 70, 126, 139, "Rendering Quality"
- PUSHBUTTON 17, 116, 44, 15, "Next >>>"
- CANCELBUTTON 61, 116, 44, 15
- TEXT 8, 3, 118, 9, "Select Render Quality:"
- LISTBOX 26, 14, 72, 62, ShadeType$, ShadePicked%
- TEXT 12, 80, 106, 33, "The RENDER types are listed in increasing RENDER quality. A high quality RENDER may take a moment."
- END DIALOG
- Return = DIALOG(Shade) 'Runs the dialog box
- If return = 2 then stop 'If the user presses ESC, cancels the script
-
- ShadePicked = ShadePicked - 1
- .ShadeEntireView -1,-1,ShadePicked,-1
- '************************************************************************************************************
-
- String1$ = "The bitmap file will now be EXPORTED from CorelCAD and IMPORTED into CorelDRAW 7.0."
- String2$ = "This may take a few moments."
- BEGIN DIALOG DispMessage2 25, 70, 316, 70,Title$
- TEXT 4, 2, 310, 17, String1$
- TEXT 4, 20, 310, 19, String2$
- TEXT 6, 46, 170, 13, "Click NEXT to proceed or CANCEL to exit the Script."
- PUSHBUTTON 198, 44, 40, 16, "Next >>>"
- CANCELBUTTON 240, 44, 40, 16
- END DIALOG
-
- Return% = DIALOG (DispMessage2)
- if Return = 2 then STOP
-
-
-
- .FileExport "c:\TempBit.BMP", 769, 1500,1600, 300, 300, 4
- END WITHOBJECT
-
- WITHOBJECT "CorelDraw.Automation.7"
-
- .filenew
- .setvisible -1
- .FileImport "c:\TempBit.BMP"
-
- beep
- BEGIN DIALOG DispMessage3 25, 70, 154, 65,Title$
- TEXT 29, 14, 98, 8, "The demonstration is complete."
- PUSHBUTTON 61, 34, 40, 16, "End"
- END DIALOG
-
- Return% = DIALOG (DispMessage3)
- if Return = 2 then STOP
-
-
-
- END WITHOBJECT
-
-
-
-
-
-
-