Skill command for Copy

Discussion in 'Cadence' started by shumble1, Mar 24, 2005.

  1. shumble1

    shumble1 Guest

    Does anybody know a skill command that will allow you to copy from one
    cell view into another cell view without a form popping up. I was
    going to use the geCopySeleSet(), but it appears that you have to use
    it to copy into the same window.
     
    shumble1, Mar 24, 2005
    #1
  2. shumble1

    Collin Weiss Guest

    dbCopyFig should work for you
    dstFig = dbCopyFig(srcFig, dstCellView, list(0:0 "R90" 2.0))
     
    Collin Weiss, Mar 24, 2005
    #2
  3. shumble1

    shumble1 Guest

    Thank you for the reply. That definitely works better than what I was
    trying to do, but it still doesn't help me with my overall problem.

    What I am trying to do is setup copy and paste keys that will take
    everything that you have selected and copy it to a hidden cell view.
    when you hit the paste key, it will go into that hidden cell view,
    select everything and allow the user to copy it back into their layout.

    I would prefer just to use the buffer on the computer to copy the data
    into, but I don't know how to do that so I was going to get around it
    by using a cellview. If you have any ideas, I would greatly appreciate
    your comments.
     
    shumble1, Mar 28, 2005
    #3
  4. shumble1

    Collin Weiss Guest

    Here is my solution to that problem:

    This code copies whatever is selected in the edit window and saves it
    in a junk cell and then the "paste" function adds that cell into the
    edit window and flattens the hierarchy one level and puts you in move
    mode with the pasted items selected. Try it.

    procedure( CopyToClipBoard( )
    prog( ( tmp cv_id libName clipboard_id figs d_inst fig dX dY listbBox
    )

    ; get important info
    cv_id = geGetEditCellView()
    libName = cv_id~>libName
    figs = nil
    listX = nil
    listY = nil
    dX = 0
    dY = 0

    if( geGetSelSetCount(cv_id)==0 then
    return(nil)
    else
    figs = geGetSelSet()
    )

    d_inst=dbOpenCellViewByType(
    libName;{ gt_lib | nil }
    "ClipBoardBuffer";t_cellName
    "layout";lt_viewName
    "maskLayout" "w";[ t_viewTypeName [ t_mode [ d_contextCellView ] ] ]

    ) ; => d_cellView / nil

    listbBox = figs~>bBox

    dX=caaar(listbBox)
    dY=cadaar(listbBox)

    foreach( tmp listbBox
    if( dX>caar(tmp) then
    dX=caar(tmp)
    )
    if( dY>cadar(tmp) then
    dY=cadar(tmp)
    )
    )

    foreach( fig figs
    dbCopyFig( fig d_inst list(-dX:-dY "R0" 1.0))
    );foreach

    );prog
    );procedure

    procedure( CutToClipBoard( )
    prog( ( tmp cv_id libName clipboard_id figs d_inst fig dX dY listbBox
    )

    ; get important info
    cv_id = geGetEditCellView()
    libName = cv_id~>libName
    figs = nil
    listX = nil
    listY = nil
    dX = 0
    dY = 0

    if( geGetSelSetCount(cv_id)==0 then
    return(nil)
    else
    figs = geGetSelSet()
    )

    d_inst=dbOpenCellViewByType(
    libName;{ gt_lib | nil }
    "ClipBoardBuffer";t_cellName
    "layout";lt_viewName
    "maskLayout" "w";[ t_viewTypeName [ t_mode [ d_contextCellView ] ] ]

    ) ; => d_cellView / nil

    listbBox = figs~>bBox

    dX=caaar(listbBox)
    dY=cadaar(listbBox)

    foreach( tmp listbBox
    if( dX>caar(tmp) then
    dX=caar(tmp)
    )
    if( dY>cadar(tmp) then
    dY=cadar(tmp)
    )
    )

    foreach( fig figs
    dbMoveFig( fig d_inst list(-dX:-dY "R0" 1.0))
    );foreach

    );prog
    );procedure


    procedure( PasteClipBoard( )
    let( ( cv_id libName db_id ( refPoint enterPoint( ) ) )

    ; get important info
    cv_id = geGetEditCellView( )
    libName = cv_id~>libName

    db_id = dbCreateInstByMasterName(
    cv_id;d_cellView
    libName;t_libName
    "ClipBoardBuffer";t_cellName
    "layout";t_viewName
    nil;t_instName
    refPoint;l_origin
    "R0";t_orient
    1;[ x_numInst ]
    ) ; => d_inst / nil

    geDeselectAllObject( )

    geSelectFig( db_id )

    geMoveSelSet( hiGetCurrentWindow() refPoint )

    dbFlattenInst(
    db_id;d_instId
    1;x_levels
    nil;[ g_flattenPCells ]
    t;[ g_preservePins ]
    t;[ g_preserveRODobjs ]
    ); => t / nil

    )
    )
     
    Collin Weiss, Mar 29, 2005
    #4
  5. shumble1

    G Vandevalk Guest

    You may want to dig into the conceopt of selectedSets ...
    Instead of copying, you are selecting.

    Then you could work with a number of selectedSets.

    (note this makes the complimentary paste function into a cut&paste job)

    - G
     
    G Vandevalk, Mar 29, 2005
    #5
  6. shumble1

    shumble1 Guest

    Thanks for the code. We tried it out and it almost gives us what we
    want. We're going to have to do a little more playing to see if we can
    improve to the functionality that we are looking for.
     
    shumble1, Mar 30, 2005
    #6
  7. shumble1

    Collin Weiss Guest

    I wouldn't mind seeing your improvements. There is always a better way
    of doing something and your alterations may prove useful to me!
     
    Collin Weiss, Mar 31, 2005
    #7
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.