Home > Community > Forums > Custom IC SKILL > Skill code to perform cut,copy paste operations( as in MS execl)

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Skill code to perform cut,copy paste operations( as in MS execl) 

Last post Tue, May 17 2011 3:08 AM by deepak1947. 2 replies.
Started by deepak1947 16 May 2011 03:12 AM. Topic has 2 replies and 1987 views
Page 1 of 1 (3 items)
Sort Posts:
  • Mon, May 16 2011 3:12 AM

    • deepak1947
    • Not Ranked
    • Joined on Tue, May 3 2011
    • Bangalore, Karnataka
    • Posts 3
    • Points 45
    Skill code to perform cut,copy paste operations( as in MS execl) Reply
    Hello, I was trying to build a skill code which could do the cut,copy, paste operations of any selected layer(s)/instances(s) from one cell view to other or from one hierarchy to other. The result would be copying/moving in the exact x,y location of selected layer(s)/instances(s) from one cell view to other or from one hierarchy to other. I tried to use the leYankFigs() and lePasteFigs() for this, but this code only copies(not moves) any selected layer(s)/instances(s) from one cell view to other. Also is acts as leYank() function wherein it copies all the layers from a selected area. The code I tried is: hiSetBindKey("Layout" "Ctrlc" "mscopy()") procedure(mscopy() prog((cv selectedset) cv=geGetEditCellView() selectedset=geGetSelectedSet() points=selectedset~>bBox temp = xCoord( lowerLeft( points )) temp1 = yCoord( lowerLeft( points )) llx = car(temp) lly = cadr(temp) urx = car(temp1) ury = cadr(temp1) lrx = urx lry = lly ulx = llx uly = ury ;leYankFigs( cv list( 0:0 10:0 10:10 0:10 ) 2 ) leYankFigs( cv list( llx:lly lrx:lry urx:ury ulx:uly ) 2) );prog );procedure hiSetBindKey("Layout" "Ctrlv" "mspaste()") procedure(mspaste() prog((cv selectedset) cv=geGetEditCellView() lePasteFigs( cv llx:lly) );prog );procedure
    Deepak
    • Post Points: 20
  • Mon, May 16 2011 12:33 PM

    Re: Skill code to perform cut,copy paste operations( as in MS execl) Reply

     Both dbMoveFig and dbCopyFig have a cellView argument which allows you to move/copy shapes from one cellView to another. Since these work on on shape at a time, you have to put them in a loop. The transform can be used to move/rotate the shapes in the new cellView:

    foreach( shape listOfShapeToMove
      dbMoveFig( shape newCellView [(0:0 "R90)] ) ;; Leave out the transform if you want things to go in the same place.
    )

     

    Ted

    • Post Points: 20
  • Tue, May 17 2011 3:08 AM

    • deepak1947
    • Not Ranked
    • Joined on Tue, May 3 2011
    • Bangalore, Karnataka
    • Posts 3
    • Points 45
    Re: Skill code to perform cut,copy paste operations( as in MS execl) Reply

    Thanks Ted!.

     I just modified the code a little for my convienence :

    hiSetBindKey("Layout" "Ctrl<Key>c" "mscopy()")

    hiSetBindKey("Layout" "Ctrl<Key>v" "mspaste()")

    procedure(mscopy()

    cv=geGetEditCellView()
    src=geGetSelectedSet()
    )

     

    procedure(mspaste()
    prog((cv2)
    cv2=geGetEditCellView()

    foreach( shape src
      dbCopyFig(shape  cv2 )
      )  
    );procedure
    );prog

     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


    hiSetBindKey("Layout" "Ctrl<Key>x" "mscut()")

    hiSetBindKey("Layout" "Ctrl<Key>m" "msmove()")

    procedure(mscut()

    cv=geGetEditCellView()
    src=geGetSelectedSet()
    )

    procedure(msmove()
    prog((cv2)
    cv2=geGetEditCellView()

    foreach( shape src
      dbMoveFig(shape  cv2 )
      )  
    );procedure
    );prog

     

     

    Deepak
    • Post Points: 5
Page 1 of 1 (3 items)
Sort Posts:
Started by deepak1947 at 16 May 2011 03:12 AM. Topic has 2 replies.