Hi Michael,
Issues with Object Selection in Custom HTML Commands & 3D Development Inquiry
Dear MoI 3D Developer,
I am currently developing custom HTML commands for MoI 3D, specifically focusing on CAM functionalities.
I've encountered a critical and persistent issue regarding object selection within the JavaScript context of
these HTML commands.
Problem Description: Object Selection in HTML Commands
Despite visually selecting objects (e.g., a face of a solid, or a standalone planar surface) in the MoI
viewport, my JavaScript code within the HTML command consistently fails to recognize these selections.
I have attempted the following methods:
1. `window.parent.moi.geometryDatabase.getObjects()` and iterating to check `obj.selected`: When iterating
through all objects returned by getObjects(), the obj.selected property for the visually selected object(s)
always returns false.
2. `window.parent.moi.geometryDatabase.getSelectedObjects()`: This method consistently returns an empty
collection (length is 0), even when objects are visibly selected.
3. `window.parent.moi.geometryDatabase.getLastSelectedObject()`: This method appears to be undefined or
inaccessible in my environment, resulting in a TypeError.
This behavior is highly unusual for a JavaScript API interacting with a CAD environment. It prevents any CAM
operation that relies on user selection from functioning correctly. Could you please clarify the correct and
reliable way to retrieve the currently selected object(s) (including faces of solids and standalone
surfaces) from within a custom HTML command's JavaScript? Is there a specific event, method, or context I
should be using to ensure the selection state is correctly propagated to the HTML command's environment?
Forward-Looking Inquiry: 3D Solid Selection and Dimension Retrieval
Looking ahead, I plan to develop more advanced 3D CAM functionalities, which will require robust interaction
with solid models. To facilitate this, I would greatly appreciate information on:
* Reliable selection of 3D solid objects: Beyond faces and surfaces, how can I reliably select and identify
entire solid objects within the JavaScript API?
* Retrieving dimensions and properties of 3D solids: Once a solid is selected, what are the appropriate API
methods to obtain its bounding box, volume, surface area, or other geometric properties necessary for CAM
calculations?
Having this information would be invaluable for the continued development of these advanced features.
Thank you for your time and assistance. I look forward to your guidance on these critical points.
I can already obtain gcode for profiling, drilling, threading, pocketing on zxc machines, on top face and on side faces, and even on normal xyz machines... can you please give me some suggestions?
thanks
Nemoz
|