IntelliCAD 11.1 Object Library | |
SetWidth Method | |
See Also |
- SegmentIndex
- Index of the line segment.
- StartWidth
- Width at the start of the line segment.
- EndWidth
- Width at the end of the line segment.
LWPolyline Object : SetWidth Method |
Description
Syntax
Visual Basic |
---|
Public Sub SetWidth( _ ByVal SegmentIndex As Integer, _ ByVal StartWidth As Double, _ ByVal EndWidth As Double _ ) |
Parameters
- SegmentIndex
- Index of the line segment.
- StartWidth
- Width at the start of the line segment.
- EndWidth
- Width at the end of the line segment.
Example
' This example adds a polyline and determines its width.
Dim myDoc As IntelliCAD.Document
Dim myPline As IntelliCAD.LWPolyline
Dim myPoints As points
Dim pt As Point
Set myDoc = ActiveDocument
Set myPoints = Library.CreatePoints
Set pt = Library.CreatePoint(1, 1, 0)
myPoints.Add
myPoints(myPoints.Count - 1).x = pt.x
myPoints(myPoints.Count - 1).y = pt.y
myPoints(myPoints.Count - 1).z = pt.z
Set pt = Library.CreatePoint(3, 3, 0)
myPoints.Add
myPoints(myPoints.Count - 1).x = pt.x
myPoints(myPoints.Count - 1).y = pt.y
myPoints(myPoints.Count - 1).z = pt.z
Set pt = Library.CreatePoint(7, 4, 0)
myPoints.Add
myPoints(myPoints.Count - 1).x = pt.x
myPoints(myPoints.Count - 1).y = pt.y
myPoints(myPoints.Count - 1).z = pt.z
Set myPline = ThisDocument.ModelSpace.AddLightWeightPolyline(myPoints)
myPline.Update
ThisDocument.Application.ZoomExtents
' Find the width of the 2nd segment
Dim sw As Double
Dim ew As Double
myPline.GetWidth 2, sw, ew
MsgBox "The starting width for the second segment is " & sw, , "Get/SetWidth Example"
' Change the starting width of the 2nd segment
myPline.SetWidth 2, 1.2, ew
myPline.GetWidth 2, sw, ew
myPline.Update
MsgBox "The starting width for the second segment is now " & sw, , "Get/SetWidth Example"
End Sub