TheSwamp
Code Red => VB(A) => Topic started by: systech on June 17, 2009, 09:28:57 AM
-
Guys,
I know that you can turn on/off layers with specific names, but is it possible to do this without knowing the layer names?
-
You can use the LIKE function.
For Each lay In lays
Set color = New AcadAcCmColor
With color
.ColorMethod = acColorMethodByACI
.ColorIndex = "2"
End With
[color=red]If UCase$(lay.Name)[/color] [color=blue]Like[/color] [color=red](("*") & ("ALIGN") & ("*")) Then[/color] [color=green]'This will freeze all layers that contain the word 'align'
'Wildcards are used before and after the word[/color]
lay.TrueColor = color
lay.Freeze = False
lay.LayerOn = True
End If
Next
-
That's cool, but what they're wanting is say you have 10 layers, all named different in different drawings, turn on 1 & turn off the others, then turn on 2 & all others off and so on. As it was just explained to me after the first conversation about it. :realmad: I love ever changing specs with software development.
-
I don't quite understand why you'd want to do that. But okie-dokie!
-
me neither
-
That's cool, but what they're wanting is say you have 10 layers, all named different in different drawings, turn on 1 & turn off the others, then turn on 2 & all others off and so on. As it was just explained to me after the first conversation about it. :realmad: I love ever changing specs with software development.
sounds like the LAYWALK command
-
That's cool, but what they're wanting is say you have 10 layers, all named different in different drawings, turn on 1 & turn off the others, then turn on 2 & all others off and so on. As it was just explained to me after the first conversation about it. :realmad: I love ever changing specs with software development.
sounds like the LAYWALK command
That was my first thought on looking at this post.
He really needs to get the spec. nailed down before going any further with this.