I'm trying to write a script that will mark a range of dimensions for vector points.
I've tried a nested For each Cmd in Cmds inside a DO UNTIL LOOP, but my
"LOOP LOGIC IS LOUSY".
I would like to enter the range from let's say feature PT150 to feature PT300
but only mark the the corresponding dimensions for the point features in that range.
The program would initially be unmarked, script would ask what the start feature name is
and the end feature name to complete the range and then mark the dimension in that
range only.
I'm sure the Code Guru's could whip the code out in no time without all the infinite loops
I generated.
VPT.SE.
Thank you for the Pseudocode and the kick in the ass to attempt
coding it my self
Not very elegant but this works with one little
glitch.
The end feature dimension is only partially marked.
The xyz and t lines are not marked on only the last feature
in the range. Everything other dimension in the range is completly marked.
Is the Cmd.Redraw in the right spo?
Hated to use a goto, but wanted to exit
the FOR loop when last feature in the range was found.
Thanks for your help.
Dim SF As String
Dim EF As String
SF = InputBox("Enter the start feature :","StartFeature")
EF = InputBox("Enter the end feature :","EndFeature")
FoundStart = False
For Each Cmd In Cmds
If Cmd.IsDimension Then
Set DimCmd = Cmd.DimensionCommand
If DimCmd.feat1 = SF Then
Cmd.Marked = TRUE
FoundStart = TRUE
End If
IF DimCmd.feat1 <> EF AND FoundStart = TRUE Then
Cmd.Marked = True
End If
IF DimCmd.feat1 = EF Then
Cmd.Marked = True
Cmd.Redraw
GOTO Label_1
End If
End If
Cmd.ReDraw
Next Cmd
Label_1:
VPT.SE.
Thank you for the Pseudocode and the kick in the ass to attempt
coding it my self
Not very elegant but this works with one little
glitch.
The end feature dimension is only partially marked.
The xyz and t lines are not marked on only the last feature
in the range. Everything other dimension in the range is completly marked.
Is the Cmd.Redraw in the right spo?
Hated to use a goto, but wanted to exit
the FOR loop when last feature in the range was found.
Thanks for your help.
Dim SF As String
Dim EF As String
SF = InputBox("Enter the start feature :","StartFeature")
EF = InputBox("Enter the end feature :","EndFeature")
FoundStart = False
For Each Cmd In Cmds
If Cmd.IsDimension Then
Set DimCmd = Cmd.DimensionCommand
If DimCmd.feat1 = SF Then
Cmd.Marked = TRUE
FoundStart = TRUE
End If
IF DimCmd.feat1 <> EF AND FoundStart = TRUE Then
Cmd.Marked = True
End If
IF DimCmd.feat1 = EF Then
Cmd.Marked = True
Cmd.Redraw
GOTO Label_1
End If
End If
Cmd.ReDraw
Next Cmd
Label_1: