 |
|
| Computers Forum Index » Computer - Cadence » zoom to selected set in Schematic editor... |
|
Page 1 of 1 |
|
| Author |
Message |
| vlsidesign... |
Posted: Fri Nov 06, 2009 1:17 am |
|
|
|
Guest
|
In Virtuoso layout tool, you can zoom in to the selection
(leZoomToSelSet). Is there a comparable schematic editor command
function? |
|
|
| Back to top |
|
|
|
| Andrew Beckett... |
Posted: Sun Nov 08, 2009 7:02 pm |
|
|
|
Guest
|
vlsidesign wrote, on 11/06/09 01:17:
Quote: In Virtuoso layout tool, you can zoom in to the selection
(leZoomToSelSet). Is there a comparable schematic editor command
function?
In IC61, you have this - it's the SKILL function schHiZoomToSelSet().
For IC5141 you could use this code. Just call abZoomSel().
Regards,
Andrew.
/* abZoomSel.il
Author A.D.Beckett
Group Structured Custom, Cadence Design Systems Ltd
Machine SUN
Modified A.D.Beckett
By Feb 04, 1998
Various procedures for zooming to selected set, and for
zooming to probed things.
***************************************************
SCCS Info: at (no spam) (#) abZoomSel.il 11/20/08.15:26:22 1.3
*/
/*************************************************
* *
* (abExtendBBox bbox at (no spam) rest xy) *
* *
* procedure to take a bounding box and extend it *
* by a list of points. *
* *
*************************************************/
(procedure (abExtendBBox bbox at (no spam) rest xy)
(let (minx maxx miny maxy coord)
(if (and (listp xy)
(listp (car xy))
(listp (car (car xy))))
(setq xy (car xy)))
(if (null bbox)
(setq bbox (list (car xy) (car xy))))
(setq minx (xCoord (lowerLeft bbox)))
(setq maxx (xCoord (upperRight bbox)))
(setq miny (yCoord (lowerLeft bbox)))
(setq maxy (yCoord (upperRight bbox)))
(foreach coord xy
(if (lessp (xCoord coord) minx) (setq minx (xCoord coord)))
(if (lessp (yCoord coord) miny) (setq miny (yCoord coord)))
(if (greaterp (xCoord coord) maxx) (setq maxx (xCoord coord)))
(if (greaterp (yCoord coord) maxy) (setq maxy (yCoord coord))))
/* return the new bbox */
(list (list minx miny) (list maxx maxy))))
/******************************************
* *
* (abEnlargeBBox bbox percent) *
* *
* extend the bounding box by a percentage *
* *
******************************************/
(procedure (abEnlargeBBox bbox percent)
(let (extendX extendY)
/* calculate extensions */
(setq extendX
(quotient
(times
(difference
(xCoord (upperRight bbox))
(xCoord (lowerLeft bbox)))
percent)
200.0))
(setq extendY
(quotient
(times
(difference
(yCoord (upperRight bbox))
(yCoord (lowerLeft bbox)))
percent)
200.0))
/* return the enlarged bounding box */
(list
(list
(difference (xCoord (lowerLeft bbox)) extendX)
(difference (yCoord (lowerLeft bbox)) extendY))
(list
(plus (xCoord (upperRight bbox)) extendX)
(plus (yCoord (upperRight bbox)) extendY)))))
/******************************************
* *
* (abBBoxToPoints bbox) *
* *
* Convert a bounding box to a point list. *
* *
******************************************/
(procedure (abBBoxToPoints bbox)
(list
(lowerLeft bbox)
(list (xCoord (lowerLeft bbox)) (yCoord (upperRight bbox)))
(upperRight bbox)
(list (xCoord (upperRight bbox)) (yCoord (lowerLeft bbox)))))
/**********************************************************
* *
* (abFindBBox select) *
* *
* Find the bounding box of the list of objects passed in. *
* Copes with partially selected objects as well. *
* *
**********************************************************/
(procedure (abFindBBox select at (no spam) optional forceWholeObject)
(let (bbox)
(foreach dbp select
(if (or forceWholeObject (geIsFigAllSelected dbp))
(setq bbox (abExtendBBox bbox (dbGetq dbp bBox)))
(let (pointList)
/* generate a point list for object, either directly or from bbox */
(unless (setq pointList (dbGetq dbp points))
(setq pointList (abBBoxToPoints (dbGetq dbp bBox))))
/* scan two lists, extending bbox if point is selected */
(mapc '(lambda (point bool)
(when bool (setq bbox (abExtendBBox bbox point))))
pointList
(geGetSelSetFigPoint dbp)))))
/* return bounding box */
bbox))
/*******************************************
* *
* (abZoomSel at (no spam) optional (select nil)) *
* *
* Zoom in on the selected set (no overlap) *
* Copes with partially selected objects *
* *
*******************************************/
(procedure (abZoomSel at (no spam) optional (select nil))
(let (bbox wind forceWholeObject)
/* get current window */
(setq wind (hiGetCurrentWindow))
/* get selected set if not passed in */
(if select
(setq forceWholeObject t)
(setq select (geGetSelSet wind)))
(setq bbox (abFindBBox select forceWholeObject))
(if bbox
(hiZoomIn wind (list (geEditToWindowPoint wind (lowerLeft bbox))
(geEditToWindowPoint wind (upperRight bbox))))
(hiDisplayAppDBox
?name 'abZSnothingSelected
?dboxBanner "Nothing Selected"
?dboxText "Nothing is selected for Zoom Selected"
?dialogType hicMessageDialog
?buttonLayout 'Close))))
/*****************************************
* *
* (abZoomSelPlus at (no spam) optional (select nil)) *
* *
* same as abZoomSel, but enlarges by 10% *
* *
*****************************************/
(procedure (abZoomSelPlus at (no spam) optional (select nil) (percent 10))
(let (bbox wind forceWholeObject)
/* get current window */
(setq wind (hiGetCurrentWindow))
/* get selected set if not passed in */
(if select
(setq forceWholeObject t)
(setq select (geGetSelSet wind)))
(setq bbox (abFindBBox select forceWholeObject))
(if bbox
(progn
(setq bbox (abEnlargeBBox bbox percent))
(hiZoomIn wind (list (geEditToWindowPoint wind (lowerLeft bbox))
(geEditToWindowPoint wind (upperRight bbox)))))
(hiDisplayAppDBox
?name 'abZSnothingSelected
?dboxBanner "Nothing Selected"
?dboxText "Nothing is selected for Zoom Selected"
?dialogType hicMessageDialog
?buttonLayout 'Close))))
/***************************************************************
* *
* (abZoomOrig win) *
* *
* simple function for zooming in at the origin *
* *
***************************************************************/
(procedure (abZoomOrig win)
(hiZoomIn win '((-0.2 -0.2) (0.2 0.2))))
/******************************************************************************
* *
* (abZoomProbes at (no spam) optional (window (hiGetCurrentWindow))) *
* *
* Zoom into probed objects. Works with nets and instances in extracted views. *
* Haven't tested with all objects, but seems to work so far! *
* *
******************************************************************************/
(procedure (abZoomProbes at (no spam) optional (window (hiGetCurrentWindow)))
(let (cellView probedObjects probedFigs)
(setq cellView (geGetEditCellView window))
;-----------------------------------------------------------------
; find all the probed objects in the current window
;-----------------------------------------------------------------
(setq probedObjects
(setof obj (foreach mapcar probe
(geGetAllProbe window) (getq probe objectId))
(equal (dbGetq obj cellView) cellView)))
(setq probedFigs
(foreach mapcan object probedObjects
(case (dbGetq object objType)
("sig"
;-------------------------------------------
; combine the figures
;-------------------------------------------
(foreach mapcan net
;----------------------------------
; get from sigs to member nets
;----------------------------------
(foreach mapcar memNet
(dbGetq object memNets)
(car memNet))
(dbGetq net figs))
)
("net"
(dbGetq object figs)
)
(t (list object))
)))
;-----------------------------------------------------------------
; zoom into them
;-----------------------------------------------------------------
(abZoomSel probedFigs)
)) |
|
|
| Back to top |
|
|
|
| vlsidesign... |
Posted: Mon Nov 09, 2009 9:44 pm |
|
|
|
Guest
|
On Nov 8, 6:02 am, Andrew Beckett <andr... at (no spam) DcEaLdEeTnEcTe.HcIoSm>
wrote:
Quote: vlsidesign wrote, on 11/06/09 01:17:
In Virtuoso layout tool, you can zoom in to the selection
(leZoomToSelSet). Is there a comparable schematic editor command
function?
In IC61, you have this - it's the SKILL function schHiZoomToSelSet().
For IC5141 you could use this code. Just call abZoomSel().
Regards,
Andrew.
/* abZoomSel.il
Author A.D.Beckett
Group Structured Custom, Cadence Design Systems Ltd
Machine SUN
Modified A.D.Beckett
By Feb 04, 1998
Various procedures for zooming to selected set, and for
zooming to probed things.
snip
;-----------------------------------------------------------------
; zoom into them
;-----------------------------------------------------------------
(abZoomSel probedFigs)
))
I am not on the new Cadence right now, so I needed your custom
function.
Thanks Andrew, it works beautifully! |
|
|
| Back to top |
|
|
|
|
|
All times are GMT
The time now is Mon Dec 07, 2009 3:56 am
|
|