How do you reference a specific object in Moi3D scripting?

 From:  Elang
12042.4 
Thank you very much for your quick responses. I truly appreciate them.

@Pilou
I want to understand Moi3D scripting as deeply as I can, so for now I'd like to set AI aside.

With all due respect to those who use it, I'm not a big fan of "vibe coding" because I think it has the potential to trap us in an illusion of competence.

That said, I'm sure I'll make good use of AI later, once I feel confident that I have a solid understanding of Moi3D scripting myself. So please don't take this as rejecting your suggestion... I completely agree that AI can be a great productivity tool.

@Michael
I'd like to start with the very basics.

So far, I've learned how to create a few solid objects using moi.command.createFactory() followed by commit(). However, I'm getting stuck once several objects have been created and I want to perform Boolean operations such as Union or Difference on just two of them.

For example, imagine there are ten objects in the scene. At that point, I've already "lost track" of the order in which they were created (again, this is me thinking in terms of CorelDRAW). Suppose I now want to perform a Union on two specific objects. I don't know how to identify those two objects as the operands for the Boolean operation. The main reason of Moi Scripting here is for automation process, like what Max Smirnov did with his _NutsAndBolts addon.

Could you please explain how ObjectList is intended to work, and what the recommended way is to obtain references to the specific objects I want?

Unlike working interactively in Moi3D, where I can visually recognize an object's shape, location, or other characteristics before selecting it, a script doesn't have that kind of intuition. From my current perspective, I don't yet understand how a script is expected to "know" which objects should become the operands of a Boolean operation.

Thank you again, Michael, for your time and for all the help you've generously given to the Moi3D community over the years. I really appreciate it.

- Elang

EDITED: 20 Jul by ELANG