Quantcast
Channel: Cadence Technology Forums
Viewing all articles
Browse latest Browse all 62623

Forum Post: RE: Accessing certain layer and get its ll and ur coordinates

$
0
0
Your requirements are a bit imprecise, so I'll provide some code which illustrates the principle. If you have a list of instances and a named layer purpose pair, you can use this code: /****************************************************************** * * * CCFfindLayerExtentFromInsts(insts lpp) * * * * Find the overall bounding box of a specified layer-purpose-pair * * across a list of instances. * * * ******************************************************************/ procedure (CCFfindLayerExtentFromInsts(insts lpp) let ((minLLX minLLY maxURX maxURY) foreach (inst insts ;------------------------------------------------------------ ; Find the matching layer purpose and get the shapes on that ; layer purpose ;------------------------------------------------------------ shapes= car ( exists (LP inst~>master~>lpps LP~>layerName== car (lpp) && LP~>purpose== cadr (lpp)))~>shapes ;------------------------------------------------------------ ; For each shape, transform the bounding box up to the parent ; cellView's coordinate system, and pull apart the coordinates, ; comparing them against the min/max found so far ;------------------------------------------------------------ foreach (shape shapes destructuringBind(((llx lly) (urx ury)) dbTransformBBox (shape~>bBox inst~>transform) minLLX= if (minLLX min (minLLX llx) llx) minLLY= if (minLLY min (minLLY lly) lly) maxURX= if (maxURX max (maxURX urx) urx) maxURY= if (maxURY max (maxURY ury) ury) ) ) ) when (minLLX list (minLLX:minLLY maxURX:maxURY) ) ) ) You'd just (say) select the instances (to experiment with) and then do: CCFfindLayerExtentFromInsts(geGetSelSet() list("PP" "drawing")) This will return the overall bBox of that layer purpose pair in the list of selected instances. You could use this return value to pass to dbCreateRect to create the rectangle in the same region. Regards, Andrew.

Viewing all articles
Browse latest Browse all 62623

Trending Articles