cv=geGetWindowCellView()
dbCreatePath(cv textlayer listedepoints width)

dbCreateLabel(cv 4 1:1 "myLabel" "centerLeft" "R0" "roman" 2)
dbCreateLabel(cv "usr2txt" x:y-20 position "upperCenter" "R0" "roman" 60)

dbCreatePolygon(cv "background" list(0:0 0:1 1:1 1:0))

dbCreatePath(cv 2 list(0:0 0:1 1:1 1:0) 4 "extendExtend")
dbCreatePath(cv list("background" "drawing") list(1:6 1:1 2:1) 2 )
dbCreatePath(cv list ("background") list(0:0 1:0 1:2 2:3) 2 "squareFlush")

dbCreateLine(cv list( 68 "drawing") list(0:0 1:5) )
dbCreateLine(cv 1 list(1:1 2:5))
dbCreateLine(cv list("wire" "drawing") list(-4:1 2:2))

println("reconnaissance du bonding actuel en cours")

cv=geGetWindowCellView()
hiGetCurrentWindow( )

procedure( sum(a b), c=a+b, println(c)) 

Squiggle Arrow (~>) 


procedure(essai(unite)
	let((instance dbid xpr ypr)
	cv=geGetWindowCellView()
	foreach(instance cv~>instances
			if(instance~>cellName=="pad" then
			   printf("turlututu")
			  ) ; if
		) ; foreach
	); let
	
); procedure	


objType=="label"
objType=="path"
objType=="inst"
objType=="rect"

cellName
objType
shapeType
		
leSearchHierarchy( cell2 list( 0:0 300:300 ) 0 "path"
list( list( "layer" "==" list( "poly1" "drawing" ) )
list( "path width" ">=" 3.0 ) ) )		


procedure(calculCentreBbox(dbid)
	x=((xCoord(upperRight(dbid~>bBox))-xCoord(lowerLeft(dbid~>bBox)))/2)+xCoord(lowerLeft(dbid~>bBox))	
	y=((yCoord(upperRight(dbid~>bBox))-yCoord(lowerLeft(dbid~>bBox)))/2)+yCoord(lowerLeft(dbid~>bBox))		
) ;procedure

procedure(Centre_Pad()
		let((instance dbid )
			port=outfile("~/position.txt")
			fprintf(port "Listing de la position des pads\n" )
			cv=geGetWindowCellView()
			foreach(instance cv~>instances
				if(instance~>cellName=="pad" then
					dbid=instance
					calculCentreBbox(dbid)
					xpr=x*1
					ypr=y*1
					fprintf(port "PAD %L a la position: %n %n \n" car(dbid~>prop~>value) xpr ypr )	
				  ) ; if	
				) ; foreach
			closte(port)
			) ; let	  		
) ; procedure	