Discussion created by BoarderGrl on Feb 13, 2012
Latest reply on Feb 14, 2012 by BoarderGrl

I am trying to get the height of placement obstructs from the top and bottom layers. Here is the code I am trying to use:


If (ValidateServer(pcbDoc) = 1) Then

    Dim PHfso, PHf1, PHdesignName, PHtoppo, PHbotpo, PHpob, PHside, PHlayct

    PHlayct = pcbDoc.LayerCount

    Set PHpob = pcbDoc.PlacementObstructs(epcbSelectAll,0)


'msgbox ("layer count is: " & PHlayct)     'just to make sure it works and it does

    Set PHside = PHpob.Layer

    msgbox PHside

    If Phlayct = PHpob.Layer Then

        PHbotpo = PHpob.Height

    ElseIf PHpob.Layer = 1 Then

        PHtoppo = PHpob.Height

    End If  


This is the part I am having a problem with, so I didn't include the rest of the code below this. I am getting a VBscript runtime error of "Object doesn't support this property or method, 'Layer'", and points to "Set PHside = PHpob.Layer Then". According to the Automation help, placementobstructs is a property of the active document, pcbDoc in this case, and .Layer is a property of placementobscructs. So I don't know why I am getting this error.


Any ideas?