home *** CD-ROM | disk | FTP | other *** search
- 'This script will demonstrate the BOOLEAN SUBTRACT 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: BOOLEAN SUBTRACT demonstration"
-
- Withobject "CorelCad.Automation.1"
-
- .FileNew
-
- String1$ = "This script will demonstrate the BOOLEAN SUBTRACT command."
- String2$ = "For more information on BOOLEAN commands 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$ = "First, a BOX will be created."
- String2$ = ""
- 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
-
- .Box -1, -70.9561, -5.34296, 60.8839, -10.3302, -58.8714, 30.4419
- .zoomtoall
-
-
- String1$ = "Two CYLINDERS will be created in such a way that they intersect with the BOX."
- String2$ = ""
- 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
-
-
- .Cylinder -1, -90.4353, -55.8332, 55.4512, -90.4353, -41.0619, 55.4512, 27.6016, -41.0619, 55.4512
- .Cylinder -1, -45.9459, -95.2608, 56.4339, -45.9459, -95.2608, 69.2702, -38.4749, 16.6776, 69.2702
- .zoomtoall
-
-
-
- String1$ = "The BOOLEAN SUBTRACT command will SUBTRACT the CYLINDERS from the BOX."
- String2$ = "This command is located in the TRANSFORM menu."
- 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
-
-
- String1$ = "The BOX to be subtracted from will be selected."
- String2$ = "The selection becomes highlighted in green."
- BEGIN DIALOG DispMessage5 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 (DispMessage5)
- if Return = 2 then STOP
-
-
- REM Highlight Box in Green
- .SelectPointAt -81.0329, 25.1537, 30.442, 0
- .deleteselection
- cross -3.01358, -27.3168, 69.2702
- .NewLayer " ", , -1, 0, 0, 0, 0, 255, 1, 6, ""
- .setcurrentlayer " "
- .Box -1, -70.9561, -5.34296, 60.8839, -10.3302, -58.8714, 30.4419
- .setcurrentlayer "Default Layer"
- .SelectPointAt -88.7166, -15.7045, 69.2702, 0
- WAIT FOR 1
- .SelectPointAt -81.0329, 25.1537, 30.442, 0
- .DELETESELECTION
- .Box -1, -70.9561, -5.34296, 60.8839, -10.3302, -58.8714, 30.4419
-
-
-
- String1$ = "The CYLINDERS will now be selected one at a time."
- String2$ = "The selections become highlighted in green."
- BEGIN DIALOG DispMessage6 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 (DispMessage6)
- if Return = 2 then STOP
-
-
- REM Highlight Box in Green
- .SelectPointAt -52.4574, -61.324, 30.3359, 0
- .NewLayer " ", , -1, 0, 0, 0, 0, 255, 1, 6, ""
- .setcurrentlayer " "
- cross 27.5711, -59.6188, 69.2702
- .Box -1, 31.6049, -73.2238, 72.3951, -92.3456, -40.53, 39.8026
- .SelectPointAt -88.7166, -15.7045, 69.2702, 0
- wait for 1
- cross -32.7556, 14.7567, 69.2702
- .Box -1, -64.0869, 22.0546, 72.4538, -22.9779, -97.0788, 40.3813
- .setcurrentlayer "Default Layer"
- .SelectPointAt -88.7166, -15.7045, 69.2702, 0
- WAIT FOR 1
- .SelectPointAt -116.506, 31.761, 0, 1
- .SelectPointAt -79.84, -49.7437, 0, 1
- .DELETESELECTION
-
- .SelectWithinRegion -47.2874, 24.0007, 69.2702, -19.5022, 8.20174, 69.2702
- .DELETESELECTION
- .SelectWithinRegion -15.6262, -14.6199, 69.2702, 10.5882, -36.3417, 69.2702
- .DELETESELECTION
- .SelectWithinRegion 13.4115, -48.1549, 69.2702, 41.0419, -67.5232, 69.2702
- .DELETESELECTION
-
-
-
- String1$ = "The CYLINDERS will now be subtracted from the BOX."
- String2$ = ""
- BEGIN DIALOG DispMessage7 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 (DispMessage7)
- if Return = 2 then STOP
-
-
- .SetPointXYZ -81.0329, 25.1537, 30.442
- .SetPointXYZ -86.9019, -34.9779, 55.4512
- .SetPointXYZ -45.7764, -117.119, 69.2702
- .SolidSubtract
-
-
- String1$ = "A MATERIAL will now be applied to the object."
- String2$ = "RENDERING may take a minute."
- BEGIN DIALOG DispMessage8 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 (DispMessage8)
- if Return = 2 then STOP
-
- .zoomtoall
- .SelectAll
- .ApplyMaterial "Jewel", "Opal"
- .ShadeSelected 0, 0, 3
-
-
- String1$ = "The BOOLEAN SUBTRACT command may be used to create a wide variety of complex solids."
- String2$ = "BOOLEAN INTERSECT and BOOLEAN INTERFERE may also be used for solid transformations."
- 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"
- end withobject
- END SUB
-
-
-
-
-