dbCreateProp , and type have to be a dbObjId

M

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 <marcel.preda@gmail.com> writes:

If I try
sh->resizedShape = shCopy
I don't know the rationale for this limitation, but

sh->resizedShape = (list shCopy)

should work.

Yours,

--
Jean-Marc
 
Marcel Preda <marcel.preda@gmail.com> writes:

On May 25, 7:50 pm, Jean-Marc Bourguet <j...@bourguet.org> wrote:
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")
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
 
On May 25, 7:50 pm, Jean-Marc Bourguet <j...@bourguet.org> wrote:
Marcel Preda <marcel.pr...@gmail.com> writes:
If I try
sh->resizedShape = shCopy

I don't know the rationale for this limitation, but

sh->resizedShape = (list shCopy)

should work.

Yours,

--
Jean-Marc
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
 
Jean-Marc Bourguet wrote, on 05/26/11 09:15:
Marcel Preda<marcel.preda@gmail.com> writes:

On May 25, 7:50 pm, Jean-Marc Bourguet<j...@bourguet.org> wrote:
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")

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,
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.
 
On Jun 1, 9:11 pm, Andrew Beckett <andr...@DcEaLdEeTnEcTe.HcIoSm>
wrote:
Jean-Marc Bourguet wrote, on 05/26/11 09:15:



Marcel Preda<marcel.pr...@gmail.com>  writes:

On May 25, 7:50 pm, Jean-Marc Bourguet<j...@bourguet.org>  wrote:
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")

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,

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.
Hi Andrew,
Thank you for the info, db*Group* functions are really what I need.

Best Regards,
Marcel
 

Welcome to EDABoard.com

Sponsor

Back
Top