home *** CD-ROM | disk | FTP | other *** search
- 'This script shall enable the user to create a solid cylinder
-
- '************************************************************************************************************
- '************************************************************************************************************
- '************************************************************************************************************
- '************************************************************************************************************
- REM ⌐ 1996 Corel Corporation. All rights reserved.
- '************************************************************************************************************
-
- REM Declare Subroutines
- declare Sub Cross(xcoo&,ycoo&,zcoo&)
- declare Sub DoLine(x1&,y1&,z1&,x2&,y2&,z2&)
- declare Sub DoCylinder(x1&,y1&,z1&,x2&,y2&,z2&,x3&,y3&,z3&)
-
-
- REM Declare Variables
- Global Title as string
-
- Rem Set Variable
- Title$ = "CorelCAD: SOLID CYLINDER demonstration"
-
- Withobject "CorelCad.Automation.1"
-
- .FILENEW
-
- string1$ = "This script will demonstrate how to create a SOLID CYLINDER."
- string2$ = "For more information on the SOLID CYLINDER tool, consult CorelCAD's On-line Help."
- BEGIN DIALOG DispMessage 25, 70, 316, 75,Title$
- TEXT 4, 4, 310, 18, String1$
- TEXT 5, 28, 310, 18, 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$ = "A CYLINDER will now be created by using the 3D SOLID: CYLINDER,CENTER and RADIUS Tool."
- string2$ = "Three points are required for the construction of the CYLINDER."
- BEGIN DIALOG DispMessage1 25, 70, 316, 75,Title$
- TEXT 4, 4, 310, 18, String1$
- TEXT 5, 28, 310, 18, 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
-
- string1$ = "The first point will be set to specify the center of the base."
- string2$ = ""
- BEGIN DIALOG DispMessage2 25, 70, 316, 75,Title$
- TEXT 4, 4, 310, 18, String1$
- TEXT 5, 28, 310, 18, 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
-
-
- Cross -60,-60,0
-
- string1$ = "The second point will be set to specify the radius of the base."
- string2$ = "The Insert Point Roll-up can be used for precise placement of points."
- string3$ = "The Insert Point Roll-up is located in the Tools menu."
- string4$ = ""
- BEGIN DIALOG DispMessage3 25, 70, 316, 98, Title$
- TEXT 4, 4, 310, 12, String1$
- TEXT 4, 18, 310, 10, String2$
- TEXT 4, 32, 310, 12, String3$
- TEXT 4, 46, 310, 11, String4$
- TEXT 4, 69, 310, 8, "Click NEXT to proceed or CANCEL to exit the Script."
- PUSHBUTTON 192, 67, 40, 16, "Next >>>"
- CANCELBUTTON 240, 67, 40, 16
- END DIALOG
-
- Return% = DIALOG (DispMessage3)
- if Return = 2 then STOP
-
- doline -60,-60,0,-30,-30,0
- .SelectPointAt -69.0982, 3.27301, 50, 0
- Cross -30,-30,0
- .setcurrentlayer " "
- .circleradius 0,-60,-60,0,-30,-30,0
-
- wait for 1
- .setcurrentlayer "Default Layer"
-
- string1$ = "The third point will be set to specify the height of the CYLINDER."
- string2$ = "Note: To move the cursor in the Z-direction while performing commands, hold the CTRL+SHIFT keys down."
- BEGIN DIALOG DispMessage4 25, 70, 316, 75,Title$
- TEXT 4, 4, 310, 18, String1
- TEXT 5, 20, 310, 18, 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
-
- doline -30,-30,0,-30,-30,60
- cross -30,-30,60
-
- Call doCylinder ( -60,-60,0,-30,-30,0,-30,-30,60 )
- .SelectPointAt -69.0982, 3.27301, 50, 0
-
- .ZoomToAll
- Wait for 2
-
- .SelectAll
- .deleteselection
-
- .Cylinder -1, -60,-60,0,-30,-30,0,-30,-30,60
- .SelectAll
-
- STRING1$ = "A MATERIAL will now be applied to the CYLINDER."
- STRING2$ = "RENDERING may take a moment."
- BEGIN DIALOG DispMessage5 25, 70, 316, 75,title
- TEXT 4, 4, 310, 18, string1
- TEXT 5, 23, 310, 18, 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
-
-
- .SelectAll
- .ApplyMaterial "Jewel", "Ambrite"
- .ShadeSelected 0, 0, 3
-
- String1$ = "The 3D SOLID TOOLBAR FLYOUT can be dragged and dropped anywhere within the working environment."
- string2$ = "For convenience, all toolbars are easily customized. The CUSTOMIZE command is located in the TOOLS menu."
- beep
- BEGIN DIALOG EndMess 25, 70, 316, 75, "FINAL HINTS"
- TEXT 4, 4, 310, 16, String1$
- TEXT 4, 25, 310, 17, String2$
- TEXT 42, 48, 118, 8, "Click END to finish the demonstation."
- PUSHBUTTON 223, 47, 40, 16, "END"
- END DIALOG
-
- ret = DIALOG(EndMess)
-
- END WITHOBJECT
- '************************************************************************************************
-
-
- SUB Cross (xcoo&,ycoo&,zcoo&)
- withobject "corelcad.automation.1"
- .SetPointXYZ xcoo, ycoo, zcoo-7
- .SetPointXYZ xcoo, ycoo, zcoo+7
- .LineSegment
- .ChangeColor 51, 255, 102
- .SetPointXYZ xcoo-7, ycoo, zcoo
- .SetPointXYZ xcoo+7, ycoo, zcoo
- .LineSegment
- .ChangeColor 0, 0, 0
- .SetPointXYZ xcoo, ycoo-7, zcoo
- .SetPointXYZ xcoo, ycoo+7, zcoo
- .LineSegment
- .ChangeColor 255, 0, 0
- .Box -1, xcoo-2, ycoo-2, zcoo-2, xcoo+2, ycoo+2, zcoo+2
- .ChangeColor 0, 204, 255
- .setpointxyz xcoo,ycoo,zcoo
- .linesegment
- wait for 1
- '.selectWithinRegion xcoo-6,ycoo-6,zcoo-6,xcoo+6,ycoo+6,zcoo+6
- end withobject
- end sub
-
-
- SUB Doline(x1&,y1&,z1&,x2&,y2&,z2&)
- WITHOBJECT "CorelCAD.automation.1"
- .NewLayer " ", , -1, 0, 0, 0, 0, 255, 0, 2, ""
- .setcurrentlayer " "
- .setpointxyz x1,y1,z1
- .setpointxyz x2,y2,z2
- .arrowLine 3,1
- .setcurrentlayer "Default Layer"
- end withobject
- END SUB
-
-
- SUB DoCylinder (x1&,y1&,z1&,x2&,y2&,z2&,x3&,y3&,z3&)
- WITHOBJECT "CorelCAD.automation.1"
- .NewLayer " ", , -1, 0, 0, 0, 0, 255, 0, 2, ""
- .setcurrentlayer " "
- .Cylinder -1, -60,-60,0,-30,-30,0,-30,-30,60
- .setcurrentlayer "Default Layer"
-
- end withobject
- END SUB
-