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

When traversing the database it is often necessary to check whether an object exists.

For example when traversing layout objects to find which is a subcircuit I do:

 For Each obj In actlay.DrawingObjects
   If InStr(obj.Element.Name,"SUBCKT") Then
which fails because some drawing objects don't have elements so what I actually need to do is:
 
 For Each obj In actlay.DrawingObjects
   If Not (obj.Element Is Nothing) Then
     If InStr(obj.Element.Name,"SUBCKT") Then


A subtlety here: it would seem clearer to say "If obj.Element Is Not Nothing" but this won't work. The "obj.Element Is Nothing" must be one clause.