tool()# Operator



  • 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?



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 28/04/2009 at 17:33, xxxxxxxx wrote:

    One or the other. Either 'emulate' the tool operation or use SendModelingCommand(). They are not intermixable afaik. If you've been following the thread about "Get Active Tool" by Shawni, you need to emulate the button clicks as well if going that direction. In order to use SendModelingCommand(), you must fill in the BaseContainer with the values as described in the C++ SDK documentation or from the description header mentioned.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 29/04/2009 at 01:09, xxxxxxxx wrote:

    tool() just gives you the active tool. There are two approaches to run a tool. One is to set all the necessary parameters of the tool with tool()#THE_TOOL_ID and then call CallButton() with the ID of the Apply button or whatever button it needs to execute the tool. The other way is to fill a BaseContainer and use it with SendModelingCommand(). You should not mix both methods.

    cheers,
    Matthias


Log in to reply