|
发表于 2017-4-11 16:46:52
|
显示全部楼层
假设你是在schematic里面选择了提个器件,想获取这个器件的selecting box,和每个pin的坐标。
下面是用来获取这些信息的脚本。
需要注意的是,获得的坐标信息,都是基于symbol本身的。如果要转换成schematic中的坐标
用dbTransformPoint 和dbTransformBBox函数。
selObj~>transform,可以获得上述函数中所需的第二输入值。
- selObj = car(geGetSelSet())
- selInstMasterCV = dbOpenCellViewByType(selObj~>master~>libName selObj~>master~>cellName "symbol" "" "r") ;open the cell view object for the master of selected instance.
- pinInfoList = nil
- selObjSelBox = car(setof(d_shape selInstMasterCV~>shapes d_shape~>objType == "rect" && d_shape~>lpp == list("instance" "drawing")))~>bBox ;to get the selecting box
- foreach(term selInstMasterCV~>terminals ;loop all the terminals
- foreach(pin term~>pins
- pinXY = centerBox(pin~>fig~>bBox)
- pinInfoList = cons(list(term~>name, pinXY, term~>direction), pinInfoList)
- );foreach(pin)
- );forech(term)
复制代码 |
|