home *** CD-ROM | disk | FTP | other *** search
- 'This script will demonstrate an application of the DEFINE and EXTRUDE commands
-
- '************************************************************************************************************
- '************************************************************************************************************
- '************************************************************************************************************
- '************************************************************************************************************
- 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#)
-
-
- REM Declare Variables
- Global Title as string
-
- Rem Set Variable
- Title$ = "CorelCAD: CIRCLE to CYLINDER demonstration"
- Withobject "CorelCad.Automation.1"
-
- .FileNew
-
- String1$ = "This script will demonstrate how to create a solid CYLINDER using a CIRCLE."
- String2$ = "For more information on the CIRCLE and EXTRUDE commands, consult CorelCAD's On-line Help."
- BEGIN DIALOG DispMessage1 25,70, 316, 70,Title$
- TEXT 4, 2, 310, 17, String1$
- TEXT 4, 20, 310, 19, String2$
- TEXT 6, 46, 310, 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
-
-
- String1$ = "A CIRCLE will be created by using the CIRCLE: CENTER and RADIUS Tool."
- String2$ = "Two points are required for the construction of the CIRCLE."
- String3$ = "A dialog box allows the user to define the CIRCLE as a surface or a wireframe."
- String4$ = ""
- BEGIN DIALOG DispMessage2 25,70, 316, 98, Title$
- TEXT 4, 4, 310, 18, String1$
- TEXT 4, 20, 310, 18, String2$
- TEXT 4, 36, 310, 18, String3$
- TEXT 4, 52, 310, 18, String4$
- TEXT 4, 68, 170, 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 (DispMessage2)
- if Return = 2 then STOP
-
-
-
- String1$ = "The first point specifies the center of the CIRCLE."
- String2$ = ""
- BEGIN DIALOG DispMessage3 25,70, 316, 70,Title$
- TEXT 4, 2, 310, 17, String1$
- TEXT 4, 20, 310, 19, String2$
- TEXT 6, 46, 310, 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 (DispMessage3)
- if Return = 2 then STOP
-
-
- Call Cross (-39.623, -52.8353, 37.9088)
-
- String1$ = "The second point specifies the radius of the CIRCLE"
- String2$ = ""
- BEGIN DIALOG DispMessage4 25,70, 316, 70,Title$
- TEXT 4, 2, 310, 17, String1$
- TEXT 4, 20, 310, 19, String2$
- TEXT 6, 46, 310, 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 (DispMessage4)
- if Return = 2 then STOP
-
- Call Doline (-39.623, -52.8353, 37.9088, -30.2082, -63.4686, 37.9088)
- Call Cross (-30.2082, -63.4686, 37.9088)
-
-
- Wait for 1
- .CircleRadius 0, -39.623, -52.8353, 37.9088, -30.2082, -63.4686, 37.9088
-
- .SelectALL
- .DeleteSelection
-
- .CircleRadius 0, -39.623, -52.8353, 37.9088, -30.2082, -63.4686, 37.9088
-
-
-
- String1$ = "The CIRCLE will now be EXTRUDED into a CYLINDER."
- String2$ = "The EXTRUDE command is located in the DRAW menu."
- String3$ = "The first point of the EXTRUDE path will now be set."
- String4$ = ""
- BEGIN DIALOG DispMessage5 25,70, 316, 98, Title$
- TEXT 4, 4, 310, 18, String1$
- TEXT 4, 20, 310, 18, String2$
- TEXT 4, 36, 310, 18, String3$
- TEXT 4, 52, 310, 18, String4$
- TEXT 4, 68, 170, 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 (DispMessage5)
- if Return = 2 then STOP
-
- .SelectALL
- Call Cross (-39.623, -52.8353, 37.9088)
-
-
-
- String1$ = "The second point of the EXTRUDE path will now be set. This will define the EXTRUDE height."
- String2$ = "Note: To move the cursor in the Z-direction while performing commands, Hold the CTRL+SHIFT keys down."
- BEGIN DIALOG DispMessage8 25,70, 316, 70,Title$
- TEXT 4, 2, 310, 17, String1$
- TEXT 4, 20, 310, 19, String2$
- TEXT 6, 46, 310, 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 (DispMessage8)
- if Return = 2 then STOP
-
- Call Doline (-39.623, -52.8353, 37.9088, -39.623, -52.8353, 87.9088)
- Call Cross (-39.623, -52.8353, 87.9088)
- .zoomtoall
- Wait for 1
- .SelectAll
- .DeleteSelection
-
- .CircleRadius 0, -39.623, -52.8353, 37.9088, -30.2082, -63.4686, 37.9088
- .SelectAll
- .SolidDefine
-
-
- 'The circle is being extruded into a cylinder.
-
- .SelectPointAt -52.991, -47.6212, 37.9088, 0
- .StartAddCmdPoint 2
- .AddCmdPoint -39.623, -52.8353, 37.9088
- .AddCmdPoint -39.623, -52.8353, 87.9088
- .EndAddCmdPoint
- .Extrude 0
- .zoomtoall
-
- beep
-
- BEGIN DIALOG DispMessage7 25, 70, 154, 65,Title$
- TEXT 29, 14, 98, 8, "The demonstration is complete."
- PUSHBUTTON 61, 34, 40, 16, "End"
- END DIALOG
-
- Return% = DIALOG (DispMessage7)
- if Return = 2 then STOP
-
-
-
-
- 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
-
-
-
-