home *** CD-ROM | disk | FTP | other *** search
- '==================================================================
- 'DEMO.BSC demonstrates many DesignCAD commands
- '==================================================================
-
- SetPoint "Set 4 points.", 4
- if sys(1) <> 4 then end
-
- Dim X(5), Y(5)
-
- for I = 1 to 4
- PointVal X(I), Y(I), I
- next I
-
- >Line
-
- 'Select the line in Point Select Mode
- >PresetPoint 1
- >PointXY 1, [X(1), Y(1)]
- >Select-2 0
-
- '====================================================================
- 'Test PointMove Command
- SetPoint "Set a point for the new location for the 1st end-point.", 1
- if sys(1) <> 1 then End
-
- PointVal XP, YP, 1
-
- >DeleteLast
-
- IPT = 1
- CMD$ = "PointMove"
- GoSub Pt2Cmd
-
- '====================================================================
- 'Test Extend Command
- SetPoint "Set a point for extending the last section of the line.", 1
- if sys(1) <> 1 then End
-
- PointVal XP, YP, 1
-
- >DeleteLast
-
- IPT = 4
- CMD$ = "Extend"
- GoSub Pt2Cmd
-
- '====================================================================
- 'Test Bend Command
- SetPoint "Set a point for moving the mid-point of the middle section", 1
- if sys(1) <> 1 then End
-
- PointVal XP, YP, 1
-
- >DeleteLast
-
- X(5) = (X(2) + X(3)) / 2
- Y(5) = (Y(2) + Y(3)) / 2
- IPT = 5
- CMD$ = "Bend"
- GoSub Pt2Cmd
-
- '====================================================================
- 'Test CutLine Command
- SetPoint "Set a point at the location to be cut.", 1
- if sys(1) <> 1 then End
-
- PointVal XP, YP, 1
-
- >DeleteLast
-
- >PresetPoint 1
- >LineSnap [XP, YP]
-
- PointVal XP, YP, 1
-
- >DeleteLast
-
- CMD$ = "CutLine"
- GoSub Pt1Cmd
-
- '====================================================================
- 'Test DeletePoint Command
- >PresetPoint 2
- >PointXY 1, [XP, YP]
- >PointRelative 1, 10, 10
- >Box
-
- 'Select the line in Point Select Mode
- >PresetPoint 1
- >PointXY 1, [XP + 10, YP + 10]
- >Select-2 0
-
- SetPoint "Select the point on the box to be deleted.", 1
- if sys(1) <> 1 then End
-
- PointVal XP, YP, 1
-
- >DeleteLast
-
- >PresetPoint 1
- >Gravity [XP, YP]
-
- PointVal XP, YP, 1
-
- >DeleteLast
-
- CMD$ = "DeletePoint"
- GoSub Pt1Cmd
-
- '====================================================================
- 'Test SelectRotate Command
- >SelectRotate 90, [XP, YP]
-
- End
-
- '====================================================================
- Pt1Cmd:
- >PresetPoint 1
- >PointXY 1, [XP, YP]
- >[CMD$]
- return
-
- '====================================================================
- Pt2Cmd:
- >PresetPoint 2
- >PointXY 1, [X(IPT), Y(IPT)]
- >PointXY 1, [XP, YP]
- >[CMD$]
- Return
-