dbCreateProp , and type have to be a dbObjId

Discussion in 'Cadence' started by Marcel Preda, May 25, 2011.

  1. Marcel Preda

    Marcel Preda Guest

    Hi there,

    Is is possible to associate to a shape a property which suppose to
    have the value an objId ?


    To give you some details.
    I have to call a procedure which gets as parameters few shapes.

    Inside of the procedure I have to copy shapes , to resize the copies,
    to do some measurements, create some log messages, and in the end of
    the procedure to delete the new created shapes.

    For some shapes the copy, resize and delete process is done many many
    times.
    This slows the execution.

    So, inside of may procedure I want to do something like this:
    When I have to resize a shape I'll to check for a property like
    "resizedShape".
    If the property does not exist then copy shape, resize the copy, and
    create a property "resizedShape" having as value the new created
    shape.
    Do some mesurements with the resizedShape, etc .
    Next time when I'll call the same procedure, with the same shape as
    parameter if the "resizedShape" exist I'll use this.

    A kind of cache.


    I've try:
    dbCreateProp(sh "resizedShape" "rect" shCopy)
    But I get: *Error* dbCreateProp: invalid propType - "rect"

    If I try
    sh->resizedShape = shCopy
    I get: *Error* dbSetq: Invalid type - db:0xf2e78e92


    One option that I have is to put the original shapes and the
    associated resized shapes into a global hash (sh as key, shCopy as
    value), but I already have some global vars and I don't like it too
    much.

    Any other suggestions ?

    Thank you,
    Marcel
     
    Marcel Preda, May 25, 2011
    #1
  2. I don't know the rationale for this limitation, but

    sh->resizedShape = (list shCopy)

    should work.

    Yours,
     
    Jean-Marc Bourguet, May 25, 2011
    #2
  3. Marcel Preda

    Marcel Preda Guest

    Hi Jean-Marc,


    Already tried it.
    It seems to work, but see below...
    ~~~~~~~~~~~~~~~~~~~
    shCopy->??
    (db:0xf2e78efe cellView db:0xf2e79e12 objType "rect"
    prop
    (db:0xf2e78662 db:0xf2e7863f) bBox
    ((1252.45 -83.75)
    (1256.05 -81.45)
    ) children
    nil groupMembers nil isAnyInst nil
    isShape t matchPoints nil net
    nil parent nil pin nil
    purpose "drawing" textDisplays nil assocTextDisplays
    nil markers nil figGroup nil
    isUnshielded nil shieldedNet1 nil shieldedNet2
    nil layerName "L43" layerNum 43
    lpp
    ("L43" "drawing") connRoutes nil routeStatus
    "normal"
    )
    sh->resizedShape = list(shCopy)
    (db:0xf2e78efe)
    sh->resizedShape~>??
    *Error* get/getq: first arg must be either symbol, list, defstruct or
    user type - -219705602
    sh->resizedShape
    (db:-219705602)

    sh->prop~>name
    ("resizedShape")
    sh->prop~>value
    ((db:-219705602))
    sh->prop~>valueType
    ("ILList")
    ~~~~~~~~~~~~~~~~~~~~~~

    Practically the db:****** is evaluated in a wrong way.
    Thank you,
    Marcel
     
    Marcel Preda, May 26, 2011
    #3
  4. Strange. I also see this but I can't explain it. I think a report to
    Cadence by your usual channel is in order.

    Yours,
     
    Jean-Marc Bourguet, May 26, 2011
    #4
  5. Jean-Marc Bourguet wrote, on 05/26/11 09:15:
    Properties can only contain simple types (i.e. integers, strings, floats and
    lists of these types - it's a bit more complicated than that, but essentially
    there's a limited set of types that can be stored in properties. See the docs on
    the valueType supported for properties). They cannot contain database objects or
    lists of dbObjects. The relationship would not be maintained if you tried to do
    this (as you've found).

    For that you should use groups (dbCreateGroup) - that's the correct interface to
    maintain relationships between objects.

    Regards,

    Andrew.
     
    Andrew Beckett, Jun 1, 2011
    #5
  6. Marcel Preda

    Marcel Preda Guest

    Hi Andrew,
    Thank you for the info, db*Group* functions are really what I need.

    Best Regards,
    Marcel
     
    Marcel Preda, Jun 3, 2011
    #6
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.