Page tree
Skip to end of metadata
Go to start of metadata

To change the layers you need to use the attributes on the Drawing Object.

For example:

 ' Code Module
Sub Main
    Dim lay As Layout
    Dim objDraw As DrawingObject
    Dim attr As Attribute

	Debug.Clear

    Set lay = Project.Schematics("MySchematic").Layout
    For Each objDraw In lay.DrawingObjects
        For Each attr In objDraw.Attributes
            Debug.Print attr.Name & " = " & attr.Value

        Next attr
		'change layer.
        objDraw.Attributes("LayerName").Value = "Mesa"
		lay.Refresh
    Next objDraw
End Sub


You can change by the LayerName or the LayerIndex attribute value. LayerName is safer in case the layer order changes.