home *** CD-ROM | disk | FTP | other *** search
Wrap
'This script will demonstrate the 2 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 2 DIRECTIONAL ARRAY" WITHOBJECT "CorelCAD.Automation.1" REM Call First Dialog .filenew String1$ = "This script will demonstrate the 2 DIRECTIONAL ARRAY command. For more information on ARRAYS consult CorelCAD's On-line Help." string2$ = "" BEGIN DIALOG DispMessage1 25, 70, 316, 70,Title$ TEXT 4, 4, 310, 18, String1$ TEXT 4, 20, 310, 18, String2$ TEXT 6, 46, 170, 18, "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 FRUSTUM will now be created. This is done using the FRUSTUM: CENTER AND RADIUS tool, located on the main toolbar in the 3D SOLID Flyout." string2$ = "" BEGIN DIALOG Dispa 25, 70, 316, 70,Title$ TEXT 4, 4, 310, 18, String1$ TEXT 4, 20, 310, 18, String2$ TEXT 6, 46, 170, 18, "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 (Dispa) if Return = 2 then STOP .Frustum -1, -60, -40, 0, -50, -40, 0, -50, -40, 10, -55.6787, -45.8934, 0 String1$ = "A 2 DIRECTIONAL ARRAY will now be performed." String2$ = "The BASE POINT of the ARRAY will be positioned at the center of the FRUSTUM." BEGIN DIALOG DispMessage2 25, 70, 316, 70,Title$ TEXT 4, 4, 310, 18, String1$ TEXT 4, 20, 310, 18, String2$ TEXT 6, 46, 170, 18, "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 cross -60,-40,0 String1$ = "The second point will indicate the first direction and distance of the ARRAY." String2$ = "The third point will indicate the second direction and distance." BEGIN DIALOG DispMessage3 25, 70, 316, 70,Title$ TEXT 4, 4, 310, 18, String1$ TEXT 4, 20, 310, 18, String2$ TEXT 6, 46, 170, 18, "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 doline -60,-40,0,-30,-40,0 wait for 1 cross -30,-40,0 doline -60,-40,0,-60,-10,0 wait for 1 cross -60,-10,0 .SelectPointAt -59.5168, -49.567, 0, 0 .TwoDArray 0, 3, 3, -60, -40, 0, -30, -40, 0, -60, -10, 0 .zoomtoall String1$ = "This ARRAY contains 9 objects,3 SOLIDS in each of the X and Y directions." String2$ = "A MATERIAL will now be applied to the FRUSTUMS." String3$ = "RENDERING may take a moment." 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 .ApplyMaterial "Jewel", "Opal" .ShadeEntireView 0,0,3,0 beep String1$ = "The distance set in each direction can be between copies (INCREMENTAL) or between the original object and the final duplicate (OVERALL)." String2$ = "The ARRAY commands are used to arrange multiple copies of objects into specific patterns." 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 '************************************************************************************************************ '************************************************************************************************************