How do you reference a specific object in Moi3D scripting?

 From:  Elang
12042.1 
Dear forum members,

I'm just beginning to learn scripting for Moi3D. Before this, most of my scripting experience was writing VBA scripts for CorelDRAW (just below intermediate level).

Because of that, I hope you'll understand if I occasionally compare Moi3D's scripting model with how CorelDRAW works. I'm completely open to learning a different approach, so please don't hesitate to correct me whenever my assumptions are wrong.

I also understand that an object in Moi3D is much more sophisticated than an object in CorelDRAW. For example, when an object is selected in Moi3D, the whole object is highlighted, and then it's possible to further select individual faces, surfaces, or edges. This is a completely new concept for me, and at the moment I don't really have a mental model of how this is represented or handled in scripting.

For your information, I have already downloaded the unofficial Moi v5 API Documentation, and I've been reading through it. However, I'm having difficulty finding the answer because I suspect that Moi3D uses an object referencing model that is fundamentally different from the one I'm familiar with in CorelDRAW.

My very first question is about object references.

How does Moi3D identify or reference a specific object among many objects in the scene, and how can I select that object through a script?

In CorelDRAW, the most recently created object is placed at the top of the object stack, making it very easy to access. For example, I could reference `Object.Index(1)` and then assign it a unique name:

code:
Object.Index(1).Name = "ChooseMe"

Later in the script, I could simply find that object again by its name.

How is this typically done in Moi3D scripting?
* What are the common ways to reference a specific object?
* Is there an equivalent to assigning a unique identifier or name?
* What approaches do experienced Moi3D scripters usually recommend?

This is probably the most fundamental question for me, but I believe understanding this concept will help me move on to more advanced scripting topics.

Thank you very much for your time, your patience, and your support.

Best regards,

- Elang