home *** CD-ROM | disk | FTP | other *** search
Wrap
'This script will demonstrate the SPHERICAL ARRAY Command '************************************************************************************************************ '************************************************************************************************************ '************************************************************************************************************ '************************************************************************************************************ 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:Creating a SPHERICAL ARRAY" WITHOBJECT "CorelCAD.Automation.1" REM Call A New File .FileNew REM Call First Dialog string1$ = "This script will demonstrate the SPHERICAL ARRAY command." string2$ = "For more information on ARRAYS consult CorelCAD's On-line Help." BEGIN DIALOG DispMessage 25, 70, 316, 75,Title$ TEXT 5, 4, 310, 11, String1$ TEXT 5, 17, 310, 20, String2$ TEXT 5, 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 Rectangle string1$ = "A CONE will be created using the CONE: CENTER and RADIUS command." string2$ = "This is located on the main toolbar in the 3D OBJECTS flyout." BEGIN DIALOG DispMessage2 25, 70, 316, 75,Title$ TEXT 5, 4, 310, 11, String1$ TEXT 5, 17, 310, 20, String2$ TEXT 5, 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 .Cone -1, -60, -20, 0, -60, -10, 0, -99.6697, -19.5316, 0 string1$ = "Two points are required for the completion of a SPHERICAL ARRAY." string2$ = "The first point will be set to specify the center of the ARRAY. The second point will specify the location of the north pole of the ARRAY." BEGIN DIALOG DispMessage3 25, 70, 316, 75,Title$ TEXT 5, 4, 310, 11, String1$ TEXT 5, 17, 310, 20, String2$ TEXT 5, 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 cross -60,-20,0 doline -60,-20,0,-60,-20,20 cross -60,-20,20 .SelectPointAt -100,-100,-100,0 .selectnext .SphericalArray 15, 5, 3, -1, -60, -20, 0, -60,-20,20 .zoomtoall string1$ = "This ARRAY is made up of 20 CONES around the equator and 10 CONES at the poles." string2$ = "There are 4 rows on either side of the equator and all of the CONES have been rotated." string3$ = "The model will now be rendered." BEGIN DIALOG DispMessage4 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 (DispMessage4) if Return = 2 then STOP .SelectWithinRegion -70.1734, -13.4743, 20, -52.2391, -26.0335, 20 .DeleteSelection .SelectAll .ApplyMaterial "Jewel", "Mother of Pearl" .ZoomIn -115.778, -4.31066, 20, 16.0877, -80.4289, 20 .ShadeEntireView 0, 0, 3, 0 String1$ = "To perform the SPHERICAL ARRAY, the user must set parameters that define the number of copies around the equator, poles, as well as the number of rows in the array." String2$ = "A practical use of the SPHERICAL ARRAY would be to construct the dimples on a golf ball." 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 '************************************************************************************************************ '************************************************************************************************************