home *** CD-ROM | disk | FTP | other *** search
- 'This script will demonstrate the BOOLEAN ADD command
-
- '********D****************************************************************************************************
- '************************************************************************************************************
- '************************************************************************************************************
- '************************************************************************************************************
- 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 ADD demonstration"
-
- Withobject "CorelCad.Automation.1"
-
- .FileNew
-
-
- String1$ = "This script will demonstrate the BOOLEAN ADD 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$ = "Two BOXES 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, -14.8784, -155.499, 135.696, 19.813, -123.115, 110.137
- .Box -1, 19.813, -155.499, 122.916, 5.8359, -134.837, 170.015
-
-
- String1$ = "The BOOLEAN ADD command will combine the two intersecting solids."
- String2$ = "The BOOLEAN ADD command is located in the TRANSFORM menu."
- 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
-
-
- REM Set First Point
-
-
- String1$ = "The first BOX to be added will be selected."
- String2$ = "The selection becomes highlighted in green."
- 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
-
-
- call cross(5.8359, -155.499, 170.015)
- REM Highlight Box in Green
- .NewLayer " ", , -1, 0, 0, 0, 0, 255, 1, 6, ""
- .setcurrentlayer " "
- .Box -1, 19.813, -155.499, 122.916, 5.8359, -134.837, 170.015
- .setcurrentlayer "Default Layer"
- .SelectPointAt -36.1455, -179.537, 170.015, 0
- wait for 1
-
- REM Delete First Point
- .SelectWithinRegion -15.4229, -114.796, 135.696, 3.34915, -126.551, 135.696
- .DeleteSelection
-
- REM Erase and Redraw
- .SelectAll
- .DeleteSelection
- .Box -1, -14.8784, -155.499, 135.696, 19.813, -123.115, 110.137
- .Box -1, 19.813, -155.499, 122.916, 5.8359, -134.837, 170.015
-
-
-
- String1$ = "The second object to be added 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 Set Second Point
- call cross(-14.8784, -155.499, 135.696)
-
-
- REM Highlight Box in Green
- .NewLayer " ", , -1, 0, 0, 0, 0, 255, 1, 6, ""
- .setcurrentlayer " "
- .Box -1, -14.8784, -155.499, 135.696, 19.813, -123.115, 110.137
- .setcurrentlayer "Default Layer"
- .SelectPointAt -36.1455, -179.537, 170.015, 0
- wait for 1
-
- REM Erase and Redraw
- .SelectAll
- .DeleteSelection
- .Box -1, -14.8784, -155.499, 135.696, 19.813, -123.115, 110.137
- .Box -1, 19.813, -155.499, 122.916, 5.8359, -134.837, 170.015
-
-
- String1$ = "The selected BOXES will now be added together to form one object."
- String2$ = ""
- 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
-
- .SetPointXYZ 20.8991, -159.049, 170.015
- .SetPointXYZ 4.77214, -189.564, 170.015
- .SolidAdd
- .ZoomToAll
- .SelectAll
- .SetEdgeRefinement 0, 6
- .SetSurfaceRefinement 2, 5
- .SelectPointAt -36.1455, -179.537, 170.015, 0
-
-
- String1$ = "A MATERIAL will now be applied to the object."
- String2$ = "RENDERING may take a minute."
- 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
-
- .SelectAll
- .ApplyMaterial "Jewel", "Opal"
- .ShadeSelected 0, 0, 3
-
-
- beep
- String1$ = "Adding solids together allows the user to create complex models. Materials, textures and lighting may also be applied."
- String2$ = "Models created in CorelCAD may be exported to an *.STL file format for industrial fabrication."
- 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
- '.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
-
-
-
-
-