I have this issue creating different objects:
in an iteration i have to create some objects and in the same time identify them by their objectId in order to destroy later.
I use :
foreach (DataRow dr in my.Rows)
{
if ( condition ==true)MYDATA.AICreateSimulatedObject(Name, Init, DATA_REQUESTS.MYOBJECT);
if (condition ==false) MYDATA.AIRemoveObject(ObjectId, DATA_REQUESTS.MYOBJECT);
}
This is the issue: when i have 2 or more object to create i cannot retrieve the object ID (i use AssignedObjectId method) :the second object is created before the first ObjectId is recognized ...maybe the iteration is faster than the system response sending me back the ID and the AssignObject isn't triggered.
I solved this breaking the iteration when the first object is created ...wait some time and do the iteration again and again..
THE solution could be to wait in the iteration until the AssignObjectId is really triggered and the Id arrives but i'm not able.
Any hint about?
Thanks
Rob
in an iteration i have to create some objects and in the same time identify them by their objectId in order to destroy later.
I use :
foreach (DataRow dr in my.Rows)
{
if ( condition ==true)MYDATA.AICreateSimulatedObject(Name, Init, DATA_REQUESTS.MYOBJECT);
if (condition ==false) MYDATA.AIRemoveObject(ObjectId, DATA_REQUESTS.MYOBJECT);
}
This is the issue: when i have 2 or more object to create i cannot retrieve the object ID (i use AssignedObjectId method) :the second object is created before the first ObjectId is recognized ...maybe the iteration is faster than the system response sending me back the ID and the AssignObject isn't triggered.
I solved this breaking the iteration when the first object is created ...wait some time and do the iteration again and again..
THE solution could be to wait in the iteration until the AssignObjectId is really triggered and the Id arrives but i'm not able.
Any hint about?
Thanks
Rob


