home *** CD-ROM | disk | FTP | other *** search
- 'This script will demonstrate the SPIRAL ARRAY Command
-
- '************************************************************************************************************
- '************************************************************************************************************
- '************************************************************************************************************
- '************************************************************************************************************
- REM ⌐ 1996 Corel Corporation. All rights reserved.
- '************************************************************************************************************
-
- 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: Creating a SPIRAL ARRAY"
-
- WITHOBJECT "CorelCAD.Automation.1"
-
- REM Call A New File
- .FileNew
-
- REM Call First Dialog
- string1$ = "This script will demonstrate the SPIRAL ARRAY command."
- string2$ = "For more information on ARRAYS consult CorelCAD's On-line Help."
- BEGIN DIALOG DispMessage 25, 70, 316, 75, Title$
- TEXT 4, 4, 310, 12, String1$
- TEXT 4, 18, 310, 10, 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
-
- REM Call Second Dialog and Draw Sphere
- string1$ = "A SPHERE will be created using the SPHERE: CENTER and RADIUS command."
- string2$ = "This is located on the main toolbar in the 3D-Solids flyout."
- BEGIN DIALOG DispMessage1 25, 70, 316, 75, Title$
- TEXT 4, 4, 310, 12, String1$
- TEXT 4, 18, 310, 10, 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
-
- .zoomout
- .zoomout
- .zoomout
- .Sphere -1, -69.6239, -60.873, 0, -62.4962, -75.5613, 0
-
- string1$ = "Two points will be set to specify the AXIS of REVOLUTION."
- string2$ = "The SPIRAL ARRAY dialog box is used to set the offset distance, which will specify the total height of the array."
- BEGIN DIALOG DispMessage2 25, 70, 316, 75, Title$
- TEXT 4, 4, 310, 12, String1$
- TEXT 4, 18, 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 -43,-9,0
- doline -43,-9,0,-100,-10,0
- cross -100,-10,0
-
- .SelectPointAt -67.7288, -51.2311, 0, 0
- .SpiralArray 30, 2, 180, -1, -43, -9, 0, -100, -10, 0
- .ZoomToAll
-
- string1$ = "The SPIRAL ARRAY contains 50 objects."
- string2$ = "The SPIRAL ARRAY has 2 revolutions with an OFFSET of 25 inches."
- string3$ = "The model will now be rendered."
- BEGIN DIALOG DispMessage3 25, 70, 316, 86,title
- TEXT 4, 4, 310, 12, string1
- TEXT 4, 18, 310, 10, string2
- TEXT 4, 59, 170, 8, "Click NEXT to proceed or CANCEL to exit the Script."
- PUSHBUTTON 192, 57, 40, 16, "Next >>>"
- CANCELBUTTON 240, 57, 40, 16
- TEXT 4, 36, 298, 15, string3
- END DIALOG
-
- Return% = DIALOG (DispMessage3)
- if Return = 2 then STOP
-
- .SelectWithinRegion -115.779, -4.41464, 0, -25.1566, -17.9643, 0
- .DeleteSelection
- .ZoomIn -145.845, 65.8135, 0, 152.637, -105.168, 0
- .SelectAll
- .ChangeColor 153, 255, 0
- .ShadeEntireView 0, 0, 3, 0
-
- String1$ = "The OPEN WINDOW LAYOUT command, located in the WINDOW menu, can be used to open multiple views of any model."
- String2$ = "The ROTATE 3D VIEW button may be used to rotate the current view."
- 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"
- wait for 1
- end withobject
- END SUB
- '************************************************************************************************************
- '************************************************************************************************************
-