home *** CD-ROM | disk | FTP | other *** search
- 'This script demonstrates the 3D SLICE command
-
- '************************************************************************************************************
- '*****R******************************************************************************************************
- '********************************y***************************************************************************
- '**********************************************************************A*************************************
- REM ⌐ 1996 Corel Corporation. All rights reserved.
- '*********************************************************************************************************N**
-
- 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:3D SLICE demonstration"
-
- Withobject "CorelCad.Automation.1"
-
- .FileNew
-
- String1$ = "This script demonstrates the 3D SLICE command."
- String2$ = "For more information on 3D SLICE 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$ = "A BOX will first 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, 7.83156, -209.925, 197.01, 39.5494, -191.084, 217.636
- .zoomtoAll
-
-
- String1$ = "3 points will be specified to define the SLICE PLANE."
- String2$ = "Once the SLICE has been completed, the object will be separated for clarity."
- 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 Select first point
- call cross(23.6905, -191.084, 217.636)
- wait for 1
-
- REM Select Second Point
- call doline(23.6905, -191.084, 217.636,23.6905, -209.925, 217.636)
- call cross(23.6905, -209.925, 217.636)
- wait for 1
-
- REM Draw First Line
-
-
-
- REM Delete First Point
- .SelectWithinRegion 8.95967, -163.289, 197.01, 25.3888, -178.662, 197.01
- .deleteselection
- .SelectAll
-
- REM Select Third Point
- call doline(23.6905, -209.925, 217.636,39.5494, -209.925, 197.01)
- call cross(39.5494, -209.925, 197.01)
- wait for 1
-
-
- REM Delete Second and Third Point
- .SelectWithinRegion 5.7578, -181.917, 197.01, 28.3854, -196.672, 197.01
- .DeleteSelection
- .SelectAll
- .SelectWithinRegion 26.5726, -202.559, 197.01, 53.4275, -222.016, 197.01
- .DeleteSelection
- .SelectAll
-
- REM Draw Third Line
- call doline(39.5494, -209.925, 197.01,23.6905, -191.084, 217.636)
- wait for 1
-
- REM Erase Third Line
- .Undo
-
- REM Draw Fourth Line and Fifth Line
- call doline(39.5494, -209.925, 197.01,39.5494, -191.084, 197.01)
- call doline(39.5494, -191.084, 197.01,23.6905, -191.084, 217.636)
- .SelectWithinRegion -10.4395, -172.396, 197.01, 49.5493, -207.25, 197.01
- .ThreeDSlice 23.6905, -191.084, 217.636, 23.6905, -209.925, 217.636, 39.5494, -209.925, 197.01
-
- .SelectAll
- .DeleteSelection
- .Box -1, 7.83156, -209.925, 197.01, 39.5494, -191.084, 217.636
- .ThreeDSlice 23.6905, -191.084, 217.636, 23.6905, -209.925, 217.636, 39.5494, -209.925, 197.01
- .SelectPointAt 32.7237, -189.114, 197.01, 0
- .Move 0, 0, 39.5494, -209.925, 217.636, 57.1783, -213.762, 217.636
- .SelectAll
-
-
- String1$ = "A MATERIAL will now be applied to the objects."
- String2$ = "RENDERING may take a moment."
- 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
-
- .zoomtoall
- .ApplyMaterial "Woods", "Lacquered"
- .ShadeEntireView 0,0,3,0
-
-
- beep
- String1$ = "The 3D SLICE command allows the user to cut any model into break-away sections."
- String2$ = "This allows the user to view the inner parts of the model."
- 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
-
-