lock layout shape from being move/stretch/delete

V

vtcad

Guest
I am looking for a way to lock selected shapes from being move/
stretched/deleted all the time. I've got a peice of code that kinda
works, but only when shapes are selected prior to entering the move/
stretched/delete command. If I start the command then select the shape
it will move them currently,.



(defun mitDoWithLock (func)
(foreach fig (geGetSelectedSet)
(when fig~>lockDown == "TRUE"
(geDeselectFig fig)))
(when t
(funcall func)));end defun


(defun mitLockDownInstance ()
(foreach fig (geGetSelectedSet)
(dbReplaceProp fig "lockDown" "boolean" t))
(printf "Locked down %d instances\n" (length
(geGetSelectedSet))));end defun


(defun mitUnLockDownInstance ()
(foreach fig (geGetSelectedSet)
(dbReplaceProp fig "lockDown" "boolean" nil))
(printf "Unlocked %d instances\n" (length (geGetSelectedSet))));end
defun


(hiSetBindKey "Layout" "<Key>s" "(mitDoWithLock 'leHiStretch)")

(hiSetBindKey "Layout" "<Key>m" "(mitDoWithLock 'leHiMove)")

(hiSetBindKey "Layout" "<Key>Delete" "(mitDoWithLock 'leHiDelete)")

(hiSetBindKey "Layout" "Ctrl<Key>l" "(mitLockDownInstance)")

(hiSetBindKey "Layout" "Ctrl<Key>u" "(mitUnLockDownInstance)")
 
On Wed, 14 Nov 2007 14:54:42 -0000, vtcad <Roland.Fontaine@gmail.com> wrote:

I am looking for a way to lock selected shapes from being move/
stretched/deleted all the time. I've got a peice of code that kinda
works, but only when shapes are selected prior to entering the move/
stretched/delete command. If I start the command then select the shape
it will move them currently,.



(defun mitDoWithLock (func)
(foreach fig (geGetSelectedSet)
(when fig~>lockDown == "TRUE"
(geDeselectFig fig)))
(when t
(funcall func)));end defun


(defun mitLockDownInstance ()
(foreach fig (geGetSelectedSet)
(dbReplaceProp fig "lockDown" "boolean" t))
(printf "Locked down %d instances\n" (length
(geGetSelectedSet))));end defun


(defun mitUnLockDownInstance ()
(foreach fig (geGetSelectedSet)
(dbReplaceProp fig "lockDown" "boolean" nil))
(printf "Unlocked %d instances\n" (length (geGetSelectedSet))));end
defun


(hiSetBindKey "Layout" "<Key>s" "(mitDoWithLock 'leHiStretch)")

(hiSetBindKey "Layout" "<Key>m" "(mitDoWithLock 'leHiMove)")

(hiSetBindKey "Layout" "<Key>Delete" "(mitDoWithLock 'leHiDelete)")

(hiSetBindKey "Layout" "Ctrl<Key>l" "(mitLockDownInstance)")

(hiSetBindKey "Layout" "Ctrl<Key>u" "(mitUnLockDownInstance)")

I've seen this done by changing the mouse bindkeys so that they don't select
anything that's marked as locked, rather than changing the move bindkeys.

Another approach is to use VirtuosoXL - you can add a constraint to an object to
indicate that it's in a fixed location (I forget the precise name for this
constraint in IC5141 or IC61). You have to enable constraint aware editing in
the VirtuosoXL options form to prevent it moving though...

Regards,

Andrew.
--
Andrew Beckett
Senior Solution Architect
Cadence Design Systems, UK.
 

Welcome to EDABoard.com

Sponsor

Back
Top