The procedure for requesting AWR support has changed. Please read all about the new AWR product support process.
Page tree
Skip to end of metadata
Go to start of metadata

The main object in the layout is a DrawingObject, which, in turn, consists of Shapes.

The drawing objects have a TypeBit that can be checked according to the code below.

 'Description=loops through every DrawingObject in a layout and returns it's TypeBit

'The available TypeBit values for a layout DrawingObject are as follows:
'mwLSF_None              = mwOSF_None,
'mwLSF_Graphics          = mwOSF_Graphics,
'mwLSF_Text              = mwOSF_Text,
'mwLSF_iNet              = mwOSF_iNet,
'mwLSF_LayCell           = mwOSF_LayCell,
'mwLSF_SubCell           = mwOSF_SubCell,
'mwLSF_CellPort          = mwOSF_CellPort,
'mwLSF_AreaPin           = mwOSF_AreaPin,
'mwLSF_LayPort           = mwOSF_LayPort,
'mwLSF_ArtworkCell       = mwOSF_ArtworkCell

'The numeric values of the TypeBit property are defined as follows:
'mwOSF_None              = 0x0, 
'mwOSF_Graphics          = 0x1, 
'mwOSF_Equation          = 0x2, 
'mwOSF_Text              = 0x4,
'mwOSF_CommonElement     = 0x8, 
'mwOSF_Wire              = 0x10, 
'mwOSF_Annotation        = 0x20,
'mwOSF_iNet              = 0x40, 
'mwOSF_MovableProbe      = 0x80, 
'mwOSF_LayCell           = 0x100,
'mwOSF_SubCell           = 0x200, 
'mwOSF_ParamFrame        = 0x400, 
'mwOSF_BySize            = 0x800, 
'mwOSF_CellPort          = 0x1000, 
'mwOSF_AreaPin           = 0x2000, 
'mwOSF_LayPort           = 0x4000,
'mwOSF_ByPositionFixed   = 0x8000, 
'mwOSF_BySize2           = 0x10000,
'mwOSF_ArtworkCell       = 0x20000,
'mwOSF_PinObject         = mwOSF_CellPort | mwOSF_LayPort | mwOSF_AreaPin,
'mwOSF_InstObject        = mwOSF_LayCell | mwOSF_SubCell


Dim dr As DrawingObject

For Each dr In Project.Schematics(1).Layout.DrawingObjects
        Debug.Print dr.InfoText + vbTab + CStr(dr.TypeBits)
Next dr
The individual Shapes within the DrawingObject will have a type which must be tested for to see what the object is. Here is sample code that does this:
'Description=loops through all drawing objects in a layout and prints out information about them, simple exmaple of how to access these.
'<Header>

' Code Module
Sub awrDumpOutDrawingObjects
Debug.Clear
        Dim sx As Schematic
        Dim DrawObj As DrawingObject
        Dim shp As Shape
        Dim attr As Attribute
        Dim vtx As Vertex
        Dim i As Integer

        Debug.Clear

        'can get units from layout and multiply verticies by multplier to give proper units
        umult = Project.Units(mwUT_Length).MultValue
        uname =  Project.Units(mwUT_Length).UnitString
        'Set lx=Project.Layout("circ1")
        'Project.Schematics("circl").Layout.
        Set sx = Project.Schematics(1)
        Debug.Print "Schematic Name = " & sx.Name
        For Each DrawObj In sx.Layout.DrawingObjects
            Debug.Print " "
                For Each shp In DrawObj.Shapes
                    shptype = shp.Type
                    Select Case shptype
                    Case mwST_Rectangle
                                Debug.Print "Shape Type = Rectangle"
                        Case mwST_Polygon ' could also use 1
                                Debug.Print "Shape Type = Polygon"
                        Case mwST_Path
                                Debug.Print "Shape Type = Path"
                        Case mwST_Ellipse
                                Debug.Print "Shape Type = Ellipse"
                        Case mwST_Text
                                Debug.Print "Shape Type = Text"
                        Case mwST_DrillHole
                                Debug.Print "Shape Type = Drill Hole"
                        Case mwST_Port
                                Debug.Print "Shape Type = Cell Port"
                        Case mwST_CellStretcher
                                Debug.Print "Shape Type = Cell Stretcher"
                        Case mwST_Arc
                                Debug.Print "Shape Type = Arc"
                        Case mwST_CellPin
                                Debug.Print "Shape Type = Cell Pin"
                    End Select

                        'Debug.Print "Shape Type = " & shp.Type
                        Debug.Print "Vertex Count = " & shp.Vertices.Count
                        Debug.Print "Drawing Layer = " & shp.DrawingLayer.Name
                        i = 1
                        For Each vtx In shp.Vertices
                                Debug.Print "Vertex[" & i & "] = { x = " & vtx.x/umult & ", y = " & vtx.y/umult &"} " &uname
                                i = i + 1
                        Next vtx
                Next shp
        Next DrawObj
End Sub