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
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