home *** CD-ROM | disk | FTP | other *** search
- 'This script shall enable the user to create a solid Sphere
-
- '************************************************************************************************************
- '************************************************************************************************************
- '************************************************************************************************************
- '************************************************************************************************************
- 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&)
- declare Sub DoSphere(x1&,y1&,z1&,x2&,y2&,z2&)
-
- REM Declare Variables
- Global Title as string
-
- Rem Set Variable
- Title$ = "CorelCAD: SOLID SPHERE demonstration"
-
- Withobject "CorelCad.Automation.1"
-
- .FILENEW
-
- string1$ = "This script will demonstrate how to create a SOLID SPHERE."
- string2$ = "For more information on the SOLID SPHERE tool, consult CorelCAD's On-line Help."
- BEGIN DIALOG DispMessage 25, 70, 316, 75,Title$
- TEXT 4, 4, 310, 21, String1$
- TEXT 5, 28, 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
-
- string1$ = "The SPHERE will now be created using the 3D SOLID: SPHERE,CENTER and RADIUS Tool."
- string2$ = "Two points are required for the construction of the SPHERE."
- BEGIN DIALOG DispMessage1 25, 70, 316, 75,Title$
- TEXT 4, 4, 310, 21, String1$
- TEXT 5, 28, 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 (DispMessage1)
- if Return = 2 then STOP
-
- string1$ = "The first point will be set to specify the center of the SPHERE."
- string2$ = ""
- BEGIN DIALOG DispMessage2 25, 70, 316, 75,Title$
- TEXT 4, 4, 310, 21, String1$
- TEXT 5, 28, 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
-
- Cross -30,-30,0
-
- string1$ = "The second point will be set to specify the radius of the SPHERE."
- string2$ = "The Insert Point Roll-up can be used for precise placement of points."
- string3$ = "The Insert Point Roll-up is located in the Tools menu."
- string4$ = ""
- BEGIN DIALOG DispMessage3 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 (DispMessage3)
- if Return = 2 then STOP
-
-
- DoLine -30,-30,0,0,0,0
- cross 0,0,0
- .SelectPointAt -69.0982, 3.27301, 50, 0
-
-
- Call dosphere ( -30,-30,0,0,0,0 )
- .SelectPointAt -69.0982, 3.27301, 50, 0
-
- .ZoomToAll
- Wait for 2
-
- .SelectAll
- .deleteselection
-
- .Sphere -1, -30,-30,0,0,0,0
-
- string1$ = "A MATERIAL will now be applied to the SPHERE."
- string2$ = "RENDERING may take a moment."
- BEGIN DIALOG DispMessage4 25, 70, 316, 75,Title$
- TEXT 4, 4, 310, 21, String1$
- TEXT 5, 28, 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
-
-
- .SelectAll
- .setsurfacerefinement 0,3
- .setsurfacerefinement 1,3
- .setsurfacerefinement 2,3
- .SetEdgeRefinement 0, 3
- .ApplyMaterial "Metallic", "Bronze"
- .ShadeSelected 0, 0, 2
-
- String1$ = "The quality of the model is affected by the REFINEMENT SETTINGS."
- String2$ = "To increase the REFINEMENTS of any model, use the REFINEMENTS dialog box, loacted in the VIEW menu."
- 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-1, ycoo-1, zcoo-1, xcoo+1, ycoo+1, zcoo+1
- .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
-
-
- SUB DoSphere(x1&,y1&,z1&,x2&,y2&,z2&)
- WITHOBJECT "CorelCAD.automation.1"
- .NewLayer " ", , -1, 0, 0, 0, 0, 255, 0, 2, ""
- .setcurrentlayer " "
- .Sphere -1, -30,-30,0,0,0,0
- .setcurrentlayer "Default Layer"
-
- end withobject
- END SUB
-