home *** CD-ROM | disk | FTP | other *** search
- 'This script will give a demonstration of the LINEAR ARRAY command in CorelCAD
- '
- '************************************************************************************************************
- '************************************************************************************************************
- '************************************************************************************************************
- '************************************************************************************************************
- 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 LINEAR ARRAY"
-
-
- WITHOBJECT "CorelCAD.Automation.1"
-
- REM Call First Dialog
- .FileNew
-
- string1$ = "This script will demonstrate the LINEAR 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 Circle
- string1$ = "A CONE will be created."
- string2$ = "This is done using the 3D SOLID CONE."
- string3$ = "It can be found on the main toolbar in the 3D Objects Flyout."
- string4$ = ""
- BEGIN DIALOG DispMessage1 25, 70, 316, 98, Title$
- TEXT 4, 4, 310, 12, String1$
- TEXT 4, 18, 310, 10, String2$
- TEXT 4, 32, 310, 12, String3$
- TEXT 4, 46, 310, 11, String4$
- TEXT 4, 69, 310, 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 (DispMessage1)
- if Return = 2 then STOP
-
-
- .Cone -1, -73, -26, 0, -66, -23, 0, -66, -23, 27
- .ZoomToAll
-
- REM Call Third Dialog and Zoom Out
- string1$ = "Using F3 we can ZOOM OUT before beginning the ARRAY."
- string2$ = ""
- BEGIN DIALOG DispMessage2 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 (DispMessage2)
- if Return = 2 then STOP
-
- .ZoomOut
- .ZoomOut
- .ZoomOut
- .ZoomOut
-
- REM Call Fourth Dialog and Perform Array
- string1$ = "The LINEAR ARRAY command will now be performed. It is located in the EDIT:ARRAY menu."
- string2$ = "A base point is first set."
- BEGIN DIALOG DispMessage3 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 (DispMessage3)
- if Return = 2 then STOP
-
-
- CROSS -73, -26, 0
-
- string1$ = "A point is set to indicate the relative distance and direction between the objects."
- string2$ = ""
- BEGIN DIALOG DispMessage4 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 (DispMessage4)
- if Return = 2 then STOP
-
-
- doLine -73, -26, 0,-73-40, -26-40, 0
- wait for 1
- cross -73-40, -26-40, 0
-
- .SelectPointAt -81.699, 0.00890302, 0, 0
- .LinearArray 0, 10, 0, 0, 0, -40, -40, 0
- .ZoomToAll
-
-
-
- REM Call Fifth Dialog and Give Information to User
- string1$ = "This ARRAY contains 10 objects, with an incremental distance of 56 inches between the objects."
- string2$ = "A MATERIAL will now be applied to the cones, RENDERING may take a moment."
- BEGIN DIALOG DispMessage5 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 (DispMessage5)
- if Return = 2 then STOP
-
-
- REM Render and Shade
- .selectall
- .ApplyMaterial "Mineral","Sand"
- .ShadeEntireView 0,0,3,0
-
- String1$ = "The base point of any array does not have to be set on the object."
- String2$ = "The array path will follow the direction and distance between the base point and the second point."
- beep
- BEGIN DIALOG DispMessage100 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
-
- 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"
- end withobject
- END SUB
- '************************************************************************************************************
- '************************************************************************************************************
-
-