Note that obj1 in pin2=obj1.pin['a0'] is not in scope of this snippet. If obj1 refers to an instance in another cell than you are working in you will get the “outside the scope” message. Note that obj1 should not be a Cell. Try type(obj1) to see what obj1 is.
Can you reproduce this behaviour without the custom import?
The nd.clear statements are better put directly after import nazca as nd
Which Nazca version are you using?
Apologies, the lines about the pins are referring to trs pin2=trs.pin[‘a0’], as the original names are slightly long and convoluted, I edited it for clarity’s sake. It turns out that it is however a cell, not an instance.
Fixed the issue – it turns out that this makes an instance