home *** CD-ROM | disk | FTP | other *** search
- REM Declare Subroutines
-
- REM Declare Variables
- Global Title as string
-
- REM Variable Declarations
- DIM i%
- DIM XCoord$
- DIM XCoordNum%
- DIM ShadeNum%
- DIM ShadeType$(7)
- DIM MatType1$(6)
- DIM MatNum1%
- DIM MatNum2%
- DIM MetType$(4)
- DIM CategoryType$(6)
- DIM GlassType$(4)
- DIM JewelType$(4)
- DIM MinType$(4)
- DIM PlasType$(4)
- DIM WoodType$(4)
- DIM ImageNum%
- DIM Yes$
- DIM YesNum%
- DIM No$
- DIM NoNum%
- DIM FileName$
- DIM FileNum%
- DIM FontType$(6)
- DIM Fontnum%
-
- Title$ = "CorelCAD: TEXT EXTRUDE demonstration"
- REM Call First Dialog Box
-
-
-
- Withobject "CorelCAD.Automation.1"
- .FileNEW
-
-
- Message " CorelDraw7.0 must be installed for this script to run."
-
- String1$ = "This script will create TEXT in CorelDRAW 7.0, PASTE it into CORELCAD, then EXTRUDE it."
- String2$ = "For more information on OLE and EXTRUDE commands, consult CorelCAD's On-line Help."
- BEGIN DIALOG DispMessage 25, 70, 316, 75,TITLE
- TEXT 4, 4, 310, 16, STRING1
- TEXT 4, 18, 310, 16, STRING2
- TEXT 4, 46, 170, 8, "Click NEXT to proceed or CANCEL to exit the Script."
- PUSHBUTTON 192, 44, 40, 16, "Next >>>"
- CANCELBUTTON 240, 44, 40, 16
- END DIALOG
-
- Return% = DIALOG (DispMessage)
- if Return = 2 then STOP
-
-
- String1$ = "CorelDRAW 7.0 will now be launched in the background. This may take a moment."
- String2$ = ""
- BEGIN DIALOG DispMessage1 25, 70, 316, 75,TITLE
- TEXT 4, 4, 310, 16, STRING1
- TEXT 4, 18, 310, 16, STRING2
- TEXT 4, 46, 170, 8, "Click NEXT to proceed or CANCEL to exit the Script."
- PUSHBUTTON 192, 44, 40, 16, "Next >>>"
- CANCELBUTTON 240, 44, 40, 16
- END DIALOG
-
- Return% = DIALOG (DispMessage1)
- if Return = 2 then STOP
-
- End Withobject
-
-
- NewText = "COREL"
-
- WITHOBJECT "CorelDraw.Automation.7"
- .fileNew
- .CreateArtisticText NewText,150000,150000
- .SelectAllobjects
-
- .SetCharacterAttributes 0, 255, "Times New Roman", 13, 900, 0, 0, 0, 0, 0, 0, 0, 1
- .SelectAllobjects
- .ConvertToCurves
- .BreakApart
- .Combine
-
- '*****************************************************************************************************************
- '*****************************************************************************************************************
- '*****************************************************************************************************************
- '*****************************************************************************************************************
- 'Select all lines prior to exporting.
- String1$ = "The TEXT has been created in CorelDRAW 7.0. (This is running in the background)."
- String2$ = "CorelDRAW 7.0 will now COPY the text to the clipboard."
- BEGIN DIALOG DispMessage2 25, 70, 316, 75,TITLE
- TEXT 4, 4, 310, 16, STRING1
- TEXT 4, 18, 310, 16, STRING2
- TEXT 4, 46, 170, 8, "Click NEXT to proceed or CANCEL to exit the Script."
- PUSHBUTTON 192, 44, 40, 16, "Next >>>"
- CANCELBUTTON 240, 44, 40, 16
- END DIALOG
-
- Return% = DIALOG (DispMessage2)
- if Return = 2 then STOP
-
- .copytoClipboard
- End Withobject
-
- Withobject "CorelCad.Automation.1"
-
- .FileNew
- String1$ = "The text will now be PASTED into CorelCAD."
- string2$ = ""
- BEGIN DIALOG DispMessage3 25, 70, 316, 75,TITLE
- TEXT 4, 4, 310, 16, STRING1
- TEXT 4, 18, 310, 16, STRING2
- TEXT 4, 46, 170, 8, "Click NEXT to proceed or CANCEL to exit the Script."
- PUSHBUTTON 192, 44, 40, 16, "Next >>>"
- CANCELBUTTON 240, 44, 40, 16
- END DIALOG
-
- Return% = DIALOG (DispMessage3)
- if Return = 2 then STOP
-
- .Editpaste
- .ZoomToAll
- .SelectAll
-
- .Move 0, 0, 0, 0, 0, 0, 0, 0
- .SelectPointAt -3.34298, 2.28576, 0, 0
- .SelectAll
- .SolidExplode
- .SolidExplode
- .SelectAll
- .SolidDefine
-
- String1$ = "The next step will be to EXTRUDE the text."
- String2$ = "This will give the text its thickness. The EXTRUDE command is found in the DRAW menu."
- BEGIN DIALOG DispMessage4 25, 70, 316, 75,TITLE
- TEXT 4, 4, 310, 16, STRING1
- TEXT 4, 18, 310, 16, STRING2
- TEXT 4, 46, 170, 8, "Click NEXT to proceed or CANCEL to exit the Script."
- PUSHBUTTON 192, 44, 40, 16, "Next >>>"
- CANCELBUTTON 240, 44, 40, 16
- END DIALOG
-
- Return% = DIALOG (DispMessage4)
- if Return = 2 then STOP
-
- ExtNum% = 6
-
- .StartAddCmdPoint 2
- .AddCmdPoint 0, 0, 0
- .AddCmdPoint 0, 0, ExtNum
- .EndAddCmdPoint
- .Extrude 0
-
-
- .ZoomToAll
- WAIT FOR 1
-
- String1$ = "The holes in the lettering will be BOOLEAN SUBTRACTED prior to RENDERING the text."
- String2$ = ""
- BEGIN DIALOG DispMessage5 25, 70, 316, 75,TITLE
- TEXT 4, 4, 310, 16, STRING1
- TEXT 4, 18, 310, 16, STRING2
- TEXT 4, 46, 170, 8, "Click NEXT to proceed or CANCEL to exit the Script."
- PUSHBUTTON 192, 44, 40, 16, "Next >>>"
- CANCELBUTTON 240, 44, 40, 16
- END DIALOG
-
- Return% = DIALOG (DispMessage5)
- if Return = 2 then STOP
-
- .SelectPointAt 30.194, 115.298, 0, 0
- .SetPointXYZ 38.565, 97.8948, 0
- .SetPointXYZ 34.7797, 96.3013, 0
- .SolidSubtract
- .SetPointXYZ 57.0253, 99.7412, 0
- .SetPointXYZ 53.7364, 96.6608, 0
- .SolidSubtract
-
- String1$ = "Select a MATERIAL to be applied to the TEXT."
- String2$ = "MATERIALS can be applied by using the MATERIAL roll-up."
- BEGIN DIALOG DispMessage6 25, 70, 316, 75,TITLE
- TEXT 4, 4, 310, 16, STRING1
- TEXT 4, 18, 310, 16, STRING2
- TEXT 4, 46, 170, 8, "Click NEXT to proceed or CANCEL to exit the Script."
- PUSHBUTTON 192, 44, 40, 16, "Next >>>"
- CANCELBUTTON 240, 44, 40, 16
- END DIALOG
-
- Return% = DIALOG (DispMessage6)
- if Return = 2 then STOP
-
- 'SHADING QUALITY
-
- 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"
-
-
- ShadeNum = 4
-
-
- 'DEFINING CATEGORY TYPES
-
- MatType1(1) = "Metallic"
- MatType1(2) = "Glass"
- MatType1(3) = "Jewel"
- MatType1(4) = "Mineral"
- MatType1(5) = "Plastics"
- MatType1(6) = "Woods"
-
-
- MatNum1 = 4
-
-
- 'DEFINING THE MATERIAL
-
-
- MatNum2 = 1
-
-
- GlassType(1) = "Crystal Blue"
- GlassType(2) = "Crystal Red"
- GlassType(3) = "Glass Green"
- GlassType(4) = "Glass Frosted"
-
- JewelType(1) = "Sapphire"
- JewelType(2) = "Ambrite"
- JewelType(3) = "Ruby"
- JewelType(4) = "Tiger's Eye"
-
- MetType(1) = "Bronze"
- MetType(2) = "Copper"
- MetType(3) = "Chrome"
- MetType(4) = "Steel"
-
- MinType(1) = "Bricks"
- MinType(2) = "Blue Marbel"
- MinType(3) = "Granite"
- MinType(4) = "Pavement"
-
- PlasType(1) = "Bumpy Orange"
- PlasType(2) = "Matte Black"
- PlasType(3) = "Shiny Red"
- PlasType(4) = "Clear Blue"
-
- WoodType(1) = "Cedar"
- WoodType(2) = "Mahogany"
- WoodType(3) = "Oak"
- WoodType(4) = "Pine"
-
- ' ************************************************************************************************
- ' ************************************************************************************************
- ' ************************************************************************************************
- ' ************************************************************************************************
-
- START:
-
- DONECOLORCHANGE:
-
- BEGIN DIALOG StartDia 25, 70, 132, 114, "Material Selection"
- LISTBOX 26, 26, 72, 56, MatType1$, MatNum1%
- OKBUTTON 15, 94, 44, 14
- CANCELBUTTON 61, 94, 44, 14
- TEXT 8, 3, 122, 9, "Select Material Category."
- GROUPBOX 20, 15, 84, 69, "Category Selection"
- END DIALOG
- Return = DIALOG(StartDia) 'Runs the dialog box
- If return = 2 then stop 'If the user presses ESC, cancels the script
- .SelectAll 'Selects the object to apply the Shading or Material.
-
-
- If MatNum1 = 1 then
-
- BEGIN DIALOG Matchange3 25, 70, 132, 115, "Material Selection"
- LISTBOX 32, 36, 72, 48, MetType$, MatNum2%
- OKBUTTON 12, 96, 48, 14
- CANCELBUTTON 64, 96, 48, 14
- TEXT 3, 8, 128, 12, "Select Material to be applied."
- GROUPBOX 26, 24, 84, 64, "Metallic Types"
- END DIALOG
- Return = DIALOG(Matchange3) 'Runs the dialog box
- If return = 2 then stop 'If the user presses ESC, cancels the script
-
- Select Case matnum2%
- Case 1
- .ApplyMaterial "Metallic", "Bronze"
- Case 2
- .ApplyMaterial "Metallic", "Copper"
- Case 3
- .ApplyMaterial "Metallic", "Chrome"
- Case 4
- .ApplyMaterial "Metallic", "Steel"
- Case else
- End Select
-
- elseif MatNum1 = 2 then
- BEGIN DIALOG Matchange1 25, 70, 133, 112, "Material Selection"
- LISTBOX 32, 36, 72, 45, GlassType$, MatNum2%
- OKBUTTON 12, 94, 48, 14
- CANCELBUTTON 64, 94, 48, 14
- TEXT 4, 8, 129, 12, "Select Material to be applied."
- GROUPBOX 26, 24, 84, 63, "Glass Types"
- END DIALOG
- Return = DIALOG(Matchange1) 'Runs the dialog box
- If Return = 2 then stop 'If the user presses ESC, cancels the script
-
- Select Case MatNum2%
- Case 1
- .ApplyMaterial "Glass","Crystal Blue"
- Case 2
- .ApplyMaterial "Glass","Crystal Red"
- Case 3
- .ApplyMaterial "Glass","Glass Green"
- Case 4
- .ApplyMaterial "Glass","Glass Frosted"
- End Select
-
- elseif matnum1 = 3 then
-
- BEGIN DIALOG Matchange2 25, 70, 130, 112, "Material Selection"
- LISTBOX 32, 36, 72, 47, JewelType$, MatNum2%
- OKBUTTON 13, 94, 48, 14
- CANCELBUTTON 65, 94, 48, 14
- TEXT 1, 8, 129, 10, "Select Material to be applied."
- GROUPBOX 26, 24, 84, 64, "Jewel Types"
- END DIALOG
- Return = DIALOG(Matchange2) 'Runs the dialog box
- If return = 2 then stop 'If the user presses ESC, cancels the script
-
- Select Case MatNum2%
- Case 1
- .ApplyMaterial "Jewel","Sapphire"
- Case 2
- .ApplyMaterial "Jewel","Ambrite"
- Case 3
- .ApplyMaterial "Jewel","Ruby"
- Case 4
- .ApplyMaterial "Jewel","Tiger's Eye"
- End Select
-
- elseif matnum1 =4 then
-
- BEGIN DIALOG Matchange4 25, 70, 134, 112, "Material Selection"
- LISTBOX 32, 36, 72, 48, MinType$, MatNum2%
- OKBUTTON 16, 94, 48, 14
- CANCELBUTTON 68, 94, 48, 14
- TEXT 4, 8, 129, 12, "Select Material to be applied."
- GROUPBOX 26, 25, 84, 64, "Mineral Types"
- END DIALOG
- Return = DIALOG(Matchange4) 'Runs the dialog box
- If return = 2 then stop 'If the user presses ESC, cancels the script
-
- Select Case MatNum2%
- Case 1
- .ApplyMaterial "Mineral","Bricks"
- Case 2
- .ApplyMaterial "Mineral","Blue Marbel"
- Case 3
- .ApplyMaterial "Mineral","Granite"
- Case 4
- .ApplyMaterial "Mineral","Pavement"
- End Select
-
- elseif matnum1=5 then
-
- BEGIN DIALOG Matchange5 25, 70, 132, 112, "Material Selection"
- LISTBOX 32, 36, 72, 46, PlasType$, MatNum2%
- OKBUTTON 14, 92, 48, 15
- CANCELBUTTON 66, 92, 48, 15
- TEXT 2, 8, 128, 12, "Select Material to be applied."
- GROUPBOX 26, 24, 84, 60, "Plastic Types"
- END DIALOG
- Return = DIALOG(Matchange5) 'Runs the dialog box
- If return = 2 then stop 'If the user presses ESC, cancels the script
-
- Select Case MatNum2%
- Case 1
- .ApplyMaterial "Plastics", "Bumpy Orange"
- Case 2
- .ApplyMaterial "Plastics", "Matte Black"
- Case 3
- .ApplyMaterial "Plastics", "Shiny Red"
- Case 4
- .ApplyMaterial "Plastics", "Clear Blue"
- End Select
-
- elseif matnum1 = 6 then
-
- BEGIN DIALOG Matchange6 25, 70, 130, 112, "Material Selection"
- LISTBOX 32, 36, 72, 48, WoodType$, MatNum2%
- OKBUTTON 16, 95, 48, 13
- CANCELBUTTON 68, 95, 48, 13
- TEXT 2, 8, 128, 12, "Select Material to be applied."
- GROUPBOX 26, 24, 84, 65, "Wood Types"
- END DIALOG
- Return = DIALOG(Matchange6) 'Runs the dialog box
- If return = 2 then stop 'If the user presses ESC, cancels the scrip
-
- Select Case MatNum2%
- Case 1
- .ApplyMaterial "Woods", "Cedar"
- Case 2
- .ApplyMaterial "Woods", "Mahogany"
- Case 3
- .ApplyMaterial "Woods", "Oak"
- Case 4
- .ApplyMaterial "Woods", "Pine"
- End Select
-
- Endif
-
- .SelectAll
- .EDITCUT
- .EDITPASTE 0,0,0
- .ZoomToAll
- .ShadeEntireView 0,0,3,0
-
- BEEP
- BEGIN DIALOG DispMessage8 25, 70, 154, 65,Title$
- TEXT 29, 14, 98, 8, "The demonstration is complete."
- PUSHBUTTON 61, 34, 40, 16, "End"
- END DIALOG
- Return% = DIALOG (DispMessage8)
- if Return = 2 then STOP
- END WITHOBJECT
-
-
-
-
-
-