Message 1 of 2
To catch all layer that have a Center lintype
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
G'day Folks,
I'm trying to write a rountine which helps cleanup externally supplied drawings/block so they can suit our internal system. Currently I'm stuck on being able to select all layers which have a "Center" linetype. I can catch everything where the layers have linetype = "Center". But I can't catch the layers where the linetype = "ByLayer". Hope that makes some sort of sense.
Below is part of the code which tries to do the above...
Sub ChangeAllToLyer() Dim ssAll As AcadSelectionSet, mEntity As AcadEntity Dim Cnt As Integer Dim lTyp As String Set ssAll = ThisDrawing.SelectionSets.Add("AllEntities") 'ThisDrawing.SelectionSets("allentites").Delete ssAll.Select acSelectionSetAll 'Cnt = ssAll.Cnt 'Debug.Print Cnt For Each mEntity In ssAll lTyp = mEntity.Linetype 'Debug.Print lTyp 'If mEntity.Linetype = "CENTER" Then If UCase(lTyp) = UCase("Center") Then mEntity.Layer = "4cl" mEntity.Color = acByLayer End If Next ssAll.Clear ssAll.Delete Set ssAll = Nothing End Sub
Also attached is a sample drawing that I've moocked up so I can see what gets updated. In theory, every layer which has a center type linetype should change to 4cl & cyan.