home *** CD-ROM | disk | FTP | other *** search
- 'This script will IMPORT a profile created in CorelDRAW 7.0 into CorelCAD and perform a CIRCULAR SWEEP on the profile
-
- '************************************************************************************************************
- '************************************************************************************************************
- '************************************************************************************************************
- '************************************************************************************************************
- 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: CIRCULAR SWEEP demonstration"
-
- REM Declare Variables
- DIM i%
- DIM XCoord$
- DIM XCoordNum%
- DIM ShadeNum%
- DIM ShadeType$(7)
- DIM MatType1$(6)
- DIM MatNum1%
- DIM MatNum2%
- DIM MetType$(4)
- DIM CategoryType$(6)
- DIM GlassType$(4)
- DIM JewelType$(4)
- DIM MinType$(4)
- DIM PlasType$(4)
- DIM WoodType$(4)
- DIM ImageNum%
- DIM Yes$
- DIM YesNum%
- DIM No$
- DIM NoNum%
- DIM FileName$
- DIM FileNum%
-
- REM First Dialog
-
- Withobject "CorelCad.Automation.1"
-
- .FileNEW
-
- String1$ = "This script will perform a CIRCULAR SWEEP on selected objects."
- String2$ = "For more information on the EXTRUDE and FREE FORM commands, consult CorelCAD's On-line Help."
- BEGIN DIALOG DispMessage 25, 70, 316, 75, Title$
- TEXT 4, 4, 310, 18, String1$
- TEXT 4, 20, 310, 18, 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 Views the CorelCAD window
- .SetVisible -1
-
- String1$ = "Three objects will be created using the FREE FORM tool."
- String2$ = "A dialog box allows the user to define the FREE FORM as a surface or a wireframe."
- BEGIN DIALOG DispMessage2 25, 70, 316, 75, Title$
- TEXT 4, 4, 310, 18, String1$
- TEXT 4, 20, 310, 18, 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
-
-
- .SetPointXYZ 4.40846, -9.82336, 0
- .SetPointXYZ 4.40846, 40.1766, 0
- .SetPointXYZ 14.4085, 40.1766, 0
- .SetPointXYZ 14.4085, 20.1766, 0
- .SetPointXYZ 44.4085, 20.1766, 0
- .SetPointXYZ 44.4085, 40.1766, 0
- .SetPointXYZ 54.4085, 40.1766, 0
- .SetPointXYZ 54.4085, -9.82336, 0
- .Plane 0
- .SetPointXYZ -5.59154, -14.8234, 0
- .SetPointXYZ -35.5915, -14.8234, 0
- .SetPointXYZ -35.5915, -4.82336, 0
- .SetPointXYZ -33.5915, -4.82336, 0
- .SetPointXYZ -33.5915, -10.8234, 0
- .SetPointXYZ -5.66802, -10.8234, 0
- .Plane 0
- .SetPointXYZ -2.60909, -10.9048, 0
- .SetPointXYZ -2.60909, -0.630858, 0
- .SetPointXYZ -1.16959, -0.630858, 0
- .SetPointXYZ -1.16959, -10.9048, 0
- .Plane 0
-
-
- .zoomtoall
- .zoomout
- .zoomout
- .SelectAll
-
- String1$ = "A CIRCULAR SWEEP will be performed on the selected objects."
- String2$ = "The CIRCULAR SWEEP command is located in DRAW: EXTRUDE menu."
- string3$ = "Two points will be set to define an axis of rotation. The sweep will occur around this axis."
- BEGIN DIALOG DispMessage3 25, 70, 316, 96, Title
- TEXT 4, 4, 308, 18, string1
- TEXT 4, 22, 308, 18, string2
- TEXT 4, 43, 309, 18, string3
- TEXT 10, 74, 170, 8, "Click NEXT to proceed or CANCEL to exit the Script."
- PUSHBUTTON 198, 72, 40, 16, "Next >>>"
- CANCELBUTTON 246, 72, 40, 16
- END DIALOG
-
- Return% = DIALOG (DispMessage3)
- if Return = 2 then STOP
-
- Call Cross ( -35.5915, -19.8234, 0 )
- Call doline ( -35.5915, -19.8234, 0, -5.59154, -19.8234, 0 )
- Call Cross ( -5.59154, -19.8234, 0 )
-
- Wait for 1.2
-
- .ZoomOut
- .SelectPointAt -41.3945, -19.1148, 0, 4
- .SelectPointAt -38.1312, -17.3566, 0, 4
- .SelectPointAt -37.5777, -14.0409, 0, 4
- .SelectPointAt -35.6288, -24.5541, 0, 4
- .SelectPointAt -25.6427, -19.8888, 0, 4
- .SelectPointAt -5.88873, -25.7479, 0, 4
- .SelectPointAt -3.19944, -25.9592, 0, 4
- .SelectPointAt -3.04233, -23.2475, 0, 4
- .SelectPointAt -0.116161, -19.6096, 0, 4
- .DeleteSelection
-
-
-
- .SelectAll
-
- .CircularSweep 20, 360, -35.5915, -19.8234, 0, -5.59154, -19.8234, 0, 0
- .ZoomToAll
-
-
-
- String1$ = "The MIRROR command will be used to mirror two objects to the opposite side of the model."
- String2$ = ""
- BEGIN DIALOG DispMessage4 25, 70, 316, 75, Title$
- TEXT 4, 4, 310, 18, String1$
- TEXT 4, 20, 310, 18, 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
-
- .SelectPointAt -52.5355, -13.4407, 60, 0
- .SelectPointAt -5.29605, -82.7783, 60, 4
- .SelectPointAt 13.0189, -55.4098, 60, 4
- .Mirror -1, 29.4085, -79.8234, 0, 29.4085, -19.8234, 60
- .SelectPointAt 165.722, -114.405, 60, 0
-
-
-
- .SelectAll
- .SetEdgeRefinement 0, 6
- .SetSurfaceRefinement 2, 5
-
- .ZoomToAll
-
-
- String1$ = "MATERIALS will now be applied to the model."
- String2$ = "RENDERING may take a moment."
- BEGIN DIALOG DispMessage5 25, 70, 316, 75, Title$
- TEXT 4, 4, 310, 18, String1$
- TEXT 4, 20, 310, 18, 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
-
-
- .SelectPointAt -5.18824, 34.9359, 0, 0
- .ApplyMaterial "Metallic", "Bronze"
- .SelectPointAt -26.3661, -24.0466, 0, 0
- .SelectPointAt 83.2073, -24.2158, 0, 4
- .ApplyMaterial "Metallic", "Brass"
- .SelectPointAt -6.72529, 2.48726, 0, 0
- .SelectPointAt 55.5025, 3.75443, 0, 4
- .ApplyMaterial "Metallic", "Chrome"
-
-
- .ShadeEntireView 0, 0, 3, 0
-
-
- String1$ = "The CIRCULAR SWEEP command may be used to sweep any 2D object to form a 3 dimensional model."
- String2$ = "2D objects imported from CorelDRAW 7 may also be swept."
-
- beep
- BEGIN DIALOG DispMessage7 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 (DispMessage7)
- 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
-
-
-
-