VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How do i know a light weight polyline is symmetrical or not?

1 REPLY 1
Reply
Message 1 of 2
yaqiz
315 Views, 1 Reply

How do i know a light weight polyline is symmetrical or not?

Hi All

 

How do i know a light weight polyline is symmetrical or not?

 

 

Thanks

 

 

1 REPLY 1
Message 2 of 2
Hallex
in reply to: yaqiz

Do you mean to check if the pline has constant width for all segments

If so try this out

Option Explicit
Sub doit()
Dim oSset As AcadSelectionSet
Dim oEnt
Dim oPline As AcadLWPolyline
Dim fCode(0) As Integer
Dim fData(0) As Variant
Dim dxfCode, dxfValue
Dim i As Integer
Dim SsetName As String

fCode(0) = 0
fData(0) = "LWPOLYLINE"

dxfCode = fCode
dxfValue = fData
SsetName = "$Poly$"
'Make sure selection set does not exist
For i = 0 To ThisDrawing.SelectionSets.count - 1
If ThisDrawing.SelectionSets.item(i).Name = SsetName Then
ThisDrawing.SelectionSets.item(i).Delete
Exit For
End If
Next i

Set oSset = ThisDrawing.SelectionSets.Add(SsetName)

oSset.Select acSelectionSetAll, , , dxfCode, dxfValue

Debug.Print "Selected " & oSset.count & " polylines"

'Process each polyline
For Each oEnt In oSset
Set oPline = oEnt
On Error Resume Next
If Not IsError(oPline.ConstantWidth) Then
Debug.Print "Polyline " & oPline.ObjectID & " has Constant width: " & oPline.ConstantWidth
Else
Debug.Print "Polyline " & oPline.ObjectID & " has not Constant width"
End If
On Error GoTo 0
Next

End Sub

 

~'J'~

_____________________________________
C6309D9E0751D165D0934D0621DFF27919

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost