home *** CD-ROM | disk | FTP | other *** search
Wrap
'This script will demonstrate basic DIMENSION commands '************************************************************************************************************ '************************************************************************************************************ '************************************************************************************************************ '************************************************************************************************************ 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: DIMENSION an existing model" WITHOBJECT "CorelCAD.Automation.1" REM Call First Dialog and Open File: "Dimension Model.ccd" .FileOpen "..\CAD\Dimension Model.ccd" .ZoomToAll String1$ = "This script will demonstrate basic DIMENSION commands." String2$ = "For more information on DIMENSION 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 Call Second Dialog String1$ = "The CorelCAD model: 'Dimension Model.ccd' will be dimensioned." String2$ = "" 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 REM Call Third Dialog string1$ = "All DIMENSION commands are located in the DIMENSION flyout." string2$ = "Several features will be dimensioned along the same axis using the CONTINUOUS LINEAR DIMENSION command." string3$ = "" string4$ = "A point must be set for each DIMENSION." BEGIN DIALOG DispMessage3 25,70, 316, 98, Title$ TEXT 4, 4, 310, 18, String1$ TEXT 4, 20, 310, 18, String2$ TEXT 4, 36, 310, 18, String3$ TEXT 4, 52, 310, 18, String4$ TEXT 4, 68, 170, 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 REM Continuous Linear Dimensioning cross -2.40968, -0.295163, 0.32122 wait for .5 cross -0.166327, -0.295163, 0.32122 wait for .5 cross 0.738017, -0.295163, 0.32122 wait for .5 cross 1.72031, -0.295163, 0.32122 wait for .5 cross 3.15722, -0.295163, 0.32122 wait for .5 cross 4.52867, -0.198644, 0.293737 wait for .5 String1$ = "A final point will be set to place the DIMENSIONING TEXT." 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 doline 4.52867, -0.198644, 0.293737,4.53385, -4.00034, 0.32122 cross 4.53385, -4.00034, 0.32122 doline -2.40968, -0.295163, 0.32122,-2.40968, -0.295163-4, 0.32122 doline -0.166327, -0.295163, 0.32122,-0.166327, -0.295163-4, 0.32122 doline 0.738017, -0.295163, 0.32122,0.738017, -0.295163-4, 0.32122 doline 1.72031, -0.295163, 0.32122,1.72031, -0.295163-4, 0.32122 doline 3.15722, -0.295163, 0.32122,3.15722, -0.295163-4, 0.32122 .StartAddCmdPoint 7 .AddCmdPoint -2.40968, -0.295163, 0.32122 .AddCmdPoint -0.166327, -0.295163, 0.32122 .AddCmdPoint 0.738017, -0.295163, 0.32122 .AddCmdPoint 1.72031, -0.295163, 0.32122 .AddCmdPoint 3.15722, -0.295163, 0.32122 .AddCmdPoint 4.52867, -0.198644, 0.293737 .AddCmdPoint 4.28459, -4.00173, 0.293737 .EndAddCmdPoint .DimensionContinuous -1, 0 REM Call Fourth Dialog and Dimension the Circles String1$ = "The circular features will now be DIMENSIONED." String2$ = "The DIAMETER DIMENSION command is used for this." 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 REM Create Third Dimension and Zoom to All cross -2.38816, -0.422934, 0.951224 wait for .5 cross -2.56672, -1.41801, 0.951224 .DimensionDiameter -1, -2.37814, -0.295163, 0.951224, -2.56672, -1.41801, 0.951224 wait for .5 Cross -1.52749, -0.795521, 0.32122 wait for .5 cross -2.33413, 1.8429, -0.187117 .DimensionDiameter -1, -1.57915, -0.295163, -0.187117, -2.33413, 1.8429, -0.187117 wait for .5 Cross -0.297104, -1.58955, -0.187117 wait for .5 cross -0.0954133, 3.03428, 0.32122 .DimensionDiameter -1, -0.166327, -1.96006, 0.32122, -0.0954133, 3.03428, 0.32122 wait for .5 Cross 1.70093, -0.856979, 0.32122 wait for .5 cross 1.85334, 1.07487, 0.32122 .DimensionDiameter -1, 1.72031, -0.887514, 0.32122, 1.85334, 1.07487, 0.32122 wait for .5 Cross 3.18251, -1.0182, 0.32122 wait for .5 cross 3.9397, 0.546413, 0.32122 .DimensionDiameter -1, 3.12569, -0.924913, 0.30332, 3.9397, 0.546413, 0.32122 wait for .5 REM Call Fifth Dialog String1$ = "The model will now be SHADED." String2$ = "RENDERING may take a moment." BEGIN DIALOG DispMessage6 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 (DispMessage6) if Return = 2 then STOP .SelectWithinRegion -3.20602, -0.404599, 0.32122, -2.3983, -1.1545, 0.32122 .deleteselection .SelectWithinRegion -2.99344, 0.523955, 0.32122, -2.21821, 0.035146, 0.32122 .deleteselection .SelectWithinRegion -2.86972, -0.00238016, 0.32122, -2.06622, -0.603701, 0.32122 .deleteselection .SelectWithinRegion -2.54049, 1.70323, 0.32122, -1.76038, 1.03203, 0.32122 .deleteselection .SelectWithinRegion -0.507464, -1.85266, 0.32122, 0.304299, -2.27716, 0.32122 .deleteselection .SelectWithinRegion -0.534707, 0.0996378, 0.32122, 0.278847, -0.605302, 0.32122 .deleteselection .SelectWithinRegion -0.520928, 3.36774, 0.32122, 0.303279, 2.66508, 0.32122 .deleteselection .SelectWithinRegion 0.405857, -0.0548474, 0.32122, 1.12079, -0.585103, 0.32122 .deleteselection .SelectWithinRegion 1.38927, 0.0530785, 0.32122, 2.11018, -0.501748, 0.32122 .deleteselection .SelectWithinRegion 1.36564, -0.61305, 0.32122, 2.05943, -1.22898, 0.32122 .deleteselection .SelectWithinRegion 1.43178, 1.32089, 0.32122, 2.13809, 0.783966, 0.32122 .deleteselection .SelectWithinRegion 2.86631, -0.741718, 0.32122, 3.45186, -1.29599, 0.32122 .deleteselection .SelectWithinRegion 2.75363, -0.0271233, 0.32122, 3.40898, -0.506218, 0.32122 .deleteselection .SelectWithinRegion 3.60622, 0.819534, 0.32122, 4.2436, 0.305198, 0.32122 .deleteselection .SelectWithinRegion 4.24343, 0.0452027, 0.32122, 4.87076, -0.414563, 0.32122 .deleteselection .SelectWithinRegion 4.22987, -3.72604, 0.32122, 4.84221, -4.23236, 0.32122 .deleteselection .SelectPointAt -1.43442, -0.874415, 0.32122, 1 .SelectPointAt 3.21786, -4.0768, 0.32122, 1 .SelectPointAt 1.78779, -4.04265, 0.32122, 1 .SelectPointAt 0.79839, -4.07613, 0.32122, 1 .SelectPointAt -0.108052, -4.05453, 0.32122, 1 .SelectPointAt -2.34227, -3.89281, 0.32122, 1 .deleteselection .ShadeEntireView -1,-1,3,0 beep String1$ = "When using CONTINUOUS LINEAR DIMENSION, double-click or press Enter to place the text at a specified distance away from the model." String2$ = "Use the DIMENSION Roll-Up, located on the DIMENSION toolbar, to change settings such as measurement units, font type and size of dimensioning text." 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-.2 .SetPointXYZ xcoo, ycoo, zcoo+.2 .LineSegment .ChangeColor 51, 255, 102 .SetPointXYZ xcoo-.2, ycoo, zcoo .SetPointXYZ xcoo+.2, ycoo, zcoo .LineSegment .ChangeColor 0, 0, 0 .SetPointXYZ xcoo, ycoo-.2, zcoo .SetPointXYZ xcoo, ycoo+.2, 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 '.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 .5,1 .setcurrentlayer "Default Layer" end withobject END SUB '************************************************************************************************************ '************************************************************************************************************