THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 28/04/2009 at 16:10, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 11.0
Platform: Windows ;
Language(s) : C.O.F.F.E.E ;
---------
I've been trying to find documentation on the tool() command. When I select tool parameters in the Attributes Manager, right click, and choose "Create Script", it will generate a script that looks like this:
> \> tool()#MDATA_EXTRUDEINNER_ANGLE=3.142; \> tool()#MDATA_EXTRUDEINNER_OFFSET=50; \>
Executing this script with the Extrude Inner tool selected will update the Angle and Offset settings.
The following code should select the Extrude Inner tool, update the settings, and execute it. But it doesn't. What happens is the tool gets selected, the settings updated correctly, but the command is performed with the default settings not the updated ones.
> \> main(doc,op) \> { \> //Activate the extrude tool \> CallCommand(450000004); \> EventAdd(); \> \> //Set the preferences for the active tool \> tool()#MDATA_EXTRUDEINNER_ANGLE=3.142; \> tool()#MDATA_EXTRUDEINNER_OFFSET=50; \> EventAdd(); \> \> //Store updated settings in container. \> var bc = doc->GetActiveTool()->GetContainer(); \> \> //Use the ExtrudeInner tool with the new settings. \> SendModelingCommand(450000004, doc, op, bc, MODIFY_POLYGONSELECTION); \> } \>
My guess is that for some reason GetContainer() isn't retrieving my updated tool settings, but I don't know why it isn't.
Any thoughts?