home *** CD-ROM | disk | FTP | other *** search
Wrap
'This script will demonstrate the CIRCULAR 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 CIRCULAR ARRAY" WITHOBJECT "CorelCAD.Automation.1" REM Call A New File .FileNew REM Call First Dialog String1$ = "This script will demonstrate the CIRCULAR 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 REM Call Second Dialog and Draw Cone String1$ = "A CONE will be created." String2$ = "This is done using the CONE: CENTER AND RADIUS command, 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 .Cone -1, -40, -50, 0, -28.2544, -50, 0, -40, 0, 0 String1$ = "The CIRCULAR ARRAY will now be performed." String2$ = "TWO points will be set to define an AXIS of REVOLUTION." 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,0, -20 doline -40,0,-20,-40,0,20 cross -40, 0, 20 .SelectPointAt -36.8171, -37.7163, 20, 0 .CircularArray 10, 360, -1, -40, 0, 20, -40, 0, -20, 0 .zoomtoall String1$ = "This ARRAY contains 10 CONES." String2$ = "The CONES have been rotated around the axis at 360 degrees." String3$ = "A MATERIAL will now be applied to the CONES." String4$ = "RENDERING may take a moment." BEGIN DIALOG DispMessage4 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 (DispMessage4) if Return = 2 then STOP .SelectWithinRegion -72.5796, 46.4471, -20, -27.0862, -16.3258, -20 .DeleteSelection .SelectAll .ApplyMaterial "Glass", "Glass Blocks" .ShadeEntireView 0, 0, 3, 0 beep String1$ = "For ARRAYS of multiple objects, the objects should be GROUPED before the array is executed. This will result in enhanced ARRAY performance." String2$ = "This grouping option is located in the TOOLS:OPTIONS dialog box." BEGIN DIALOG DispMessage100 25, 70, 316, 75, "FINAL HINTS" TEXT 4, 4, 310, 18, String1$ TEXT 4, 25, 310, 18, String2$ TEXT 42, 48, 118, 8, "Click END to finish the demonstation." PUSHBUTTON 223, 47, 40, 16, "END" END DIALOG Return% = DIALOG (DispMessage100) 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" wait for 1 end withobject END SUB '************************************************************************************************************ '************************************************************************************************************