home *** CD-ROM | disk | FTP | other *** search
Wrap
'This script will demonstrate the 3 DIRECTIONAL 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 3 DIRECTIONAL ARRAY" WITHOBJECT "CorelCAD.Automation.1" REM Call First Dialog .filenew String1$ = "This script will demonstrate the 3 DIRECTIONAL ARRAY command." String2$ = "For more information on ARRAYS 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 SPHERE will now be created." String2$ = "This is done using the SPHERE: CENTER AND RADIUS tool, located on the main toolbar in the 3D SOLID flyout." BEGIN DIALOG DispMessage2 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 (DispMessage2) if Return = 2 then STOP .zoomout .zoomout .zoomout .Sphere -1, -40, -40, 0, -25, -40, 0 String1$ = "A 3 DIRECTIONAL ARRAY will now be performed." String2$ = "The BASE POINT of the ARRAY will be positioned at the center of the SPHERE." 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 cross -40,-40,0 String1$ = "Three additional points are required for directions and distances." String2$ = "Points will be set on the X,Y and Z axis'." 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 doline -40,-40,0,-15,-40,0 cross -15,-40,0 doline -40,-40,0,-40,-15,0 cross -40,-15,0 doline -40,-40,0,-40,-40,25 cross -40,-40,25 .SelectPointAt -44, -25.3593, 0, 0 .ThreeDArray 0, 3, 3, 3, -60, -60, 0, -35, -60, 0, -60, -35, 0, -60, -60, 25 .zoomtoall REM Call Fourth Dialog and Perform Array REM Call Fifth Dialog and Give Information to User string1$ = "This ARRAY contains 27 objects." string2$ = "There are 3 SPHERES in each of the X,Y and Z directions, with an incremental distance of 25 inches between copies." string3$ = "A MATERIAL will now be applied to the SPHERES." string4$ = "RENDERING may take a moment." BEGIN DIALOG DispMessage5 25, 70, 316, 97,Title$ TEXT 4, 4, 310, 18, String1$ TEXT 4, 20, 310, 18, String2$ TEXT 5, 43, 310, 12, String3$ TEXT 4, 56, 310, 11, 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 .Applymaterial "Metallic","Chrome" .shadeentireView 0,0,3,0 beep String1$ = "The Insert Point Roll-Up can be used to precisely set the distances between the copies in the array. This Roll-Up can be found in the TOOLS menu." String2$ = "Points in the Z-Direction may also be defined by holding down the CTRL+SHIFT keys." 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 '************************************************************************************************************ '************************************************************************************************************