THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 02/10/2005 at 08:18, xxxxxxxx wrote:
_I generate the objects by myself at runtime of the coffee- Script.
I don't use C or C++ - only R9.5 Coffee-Console!
to create the Objekt I use this Code:
var Bone = new(BoneObject);
Bone->SetName("Objekt1");
doc->InsertObject(Bone,NULL,NULL);
Is "Objekt1" the name I can use?
Or how can I get the Number of the object?_
Yes, if you are using FindObject() by its name, use "Objekt1". Note that, according to the documentation, if there are multiple objects with the same name, it will always return the first one.
I don't know much about these so-called COFFEE 'Markers'. Here is a function used by the base class of many other classes, from the documentation:
BaseList2D::GetMarker()
{Marker} GetMarker();
Returns a unique marker that can be used to locate the object during runtime. Markers are only only valid while the program is running.
So, it appears that right after you create+insert your new object, you should get a Marker and store it:
var Bone = new(BoneObject);
Bone->SetName("Objekt1");
doc->InsertObject(Bone,NULL,NULL);
// var BoneMarker declared somewhere with larger scope
BoneMarker = Bone->GetMarker();
The problem is in scope persistence. Note that the Marker is only valid while the program is running. You could just as easily store 'var Bone' globally, maybe in an array, to get at your objects.
So, with that said, if the object names are going to remain unique, you should consider using FindObject("name") instead of FindObject(Marker).