IntelliCAD 11.1 Object Library
GetWidth Method
See Also 
Index

Index of the line segment.

StartWidth
Width at the start of the line segment.
EndWidth
Width at the end of the line segment.
Polyline Object : GetWidth Method

Description

Returns the start and end width for a polyline.

Syntax

Visual Basic
Public Sub GetWidth( _
   ByVal Index As Integer, _
   ByRef StartWidth As Double, _
   ByRef EndWidth As Double _
) 

Parameters

Index

Index of the line segment.

StartWidth
Width at the start of the line segment.
EndWidth
Width at the end of the line segment.

Example

Private Sub GetWidth_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

See Also

© 2022 IntelliCAD Technology Consortium. All Rights Reserved.