![]() |
#1
|
|||
|
|||
![]()
is there a way to count curve and line segments in one line of code like i can when counting the total segments?
below is what i'm doing currently and it seems really slow: Code:
For Each seg In ActiveShape.Curve.Segments Select Case seg.Type Case cdrLineSegment LineCount = LineCount + 1 LineLength = LineLength + seg.Length Case cdrCurveSegment CurveCount = CurveCount + 1 curveLength = curveLength + seg.Length End Select Next seg Code:
ActiveShape.Curve.Segments.Count |
#2
|
||||
|
||||
![]()
I am guess what you have is the only way. The help file says to do it like this, which is just like you have it.
Code:
Sub Test() Dim seg As Segment, ls As Long, cs As Long If ActiveShape Is Nothing Then Exit Sub If ActiveShape.Type <> cdrCurveShape Then Exit Sub ls = 0 cs = 0 For Each seg In ActiveShape.Curve.Segments Select Case seg.Type Case cdrLineSegment ls = ls + 1 Case cdrCurveSegment cs = cs + 1 End Select Next seg MsgBox "The current curve has " & ActiveShape.Curve.Segments.Count & _ " segments including:" & vbCr & _ "Line segments: " & ls & vbCr & _ "Curve segments: " & cs End Sub |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
New user - curve default? - dxf conversion? | Anonymous | CurveWorks | 2 | 16-05-2003 11:23 |
I can't let the text on a curve line | Dino | CorelDRAW/Corel DESIGNER VBA | 2 | 11-04-2003 05:13 |