I am trying to write some Jython code that will simply create a new node 
using PrimitiveNode.newInstance(). However, there are several issues that 
arise that I would appreciate some feedback. The code is below:

from com.sun.electric.database.geometry import (ERectangle, Poly, EPoint)
from com.sun.electric.technology import (Technology, PrimitiveNode, EdgeH, 
EdgeV, ArcProto, TechFactory, Xml)
from java.awt import Rectangle


l=tech.findLayer("Metal-1")
p=tech.findLayer("Polysilicon-1")
e=ERectangle.fromFixp(0,0,5,5)
print 'Rect1 bounds',

print e.getBounds()
ttf=Technology.findTechnology("mocmos")
print 'Technology',
print ttf

edg1=EdgeH(0.5, 0.0)
edg2=EdgeV(0.5, 0.0)
edg3=EdgeH(-0.5, 0.0)
edg4=EdgeV(-0.5, 0.0)

tp1=Technology.TechPoint(edg1, edg2)
tp2=Technology.TechPoint(edg3, edg4)

tl1=Technology.NodeLayer(p, 1, Poly.Type.FILLED, 2, [tp1, tp2])
tl2=Technology.NodeLayer(l, 3, Poly.Type.FILLED, 4, [tp1, tp2])
#
#aRect=ERectangle.fromFixp(0, 0, 10, 15)
r=Rectangle(5, 10, 20, 30)
aRect=ERectangle.fromFixp(r)
print 'Rect2 bounds',
print aRect.getBounds()
pres=PrimitiveNode.newInstance('YRES', ttf, 10.0, 15.0, aRect, [tl1, tl2])
#pres=PrimitiveNode.newInstance('YRES', ttf, 10.0, 15.0,  [tl1, tl2]) 

When I run the script from Electric I get the following messages:


Rect1 bounds java.awt.Rectangle[x=0,y=0,width=1,height=1]
Technology Technology mocmos
Rect2 bounds java.awt.Rectangle[x=0,y=0,width=1,height=1]
Jython: Traceback (most recent call last):
  File "<string>", line 41, in <module>
at com.sun.electric.util.math.EDimension.<init>(EDimension.java:54)
at com.sun.electric.technology.PrimitiveNode.<init>(PrimitiveNode.java:820)
at com.sun.electric.technology.PrimitiveNode.<init>(PrimitiveNode.java:785)
at 
com.sun.electric.technology.PrimitiveNode.newInstance(PrimitiveNode.java:1095)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)

java.lang.IllegalArgumentException: java.lang.IllegalArgumentException


Issue #1: Although the two rectangles are defined with different 
dimensions, the getBounds() return the same value for both.

Issue #2:Why do I get the IllegalArgumentException. As far as I can make 
out, I have used the arguments as described in the documentation.

Any insight into this or suggestions will be appreciated.

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Electric VLSI Editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to