ConfigurationRule.toJson Method

Parent Object: ConfigurationRule

PreviewThis functionality is provided as a preview of intended future API capabilities. You are encouraged to use it and report any problems or suggestions using the Fusion API and Scripts forum.

Because this is a preview of future functionality, there is the possibility that it will change, which will possibly break any existing programs that use this functionality. Because of that, you should never deliver any programs that use any preview capabilities. For a distributed program, you should wait until it has moved from preview to released state.


Defined in namespace "adsk::fusion" and the header file is <Fusion/ConfigurationRules/ConfigurationRule.h>

Description

Serialises the full rule (id, name, comment, isActive, body) to a JSON object string matching the wire schema. Pairs with ConfigurationRule.fromJson for the inverse direction. Useful for round-tripping a rule through external tooling such as an MCP agent.

Syntax

"configurationRule_var" is a variable referencing a ConfigurationRule object.

returnValue = configurationRule_var.toJson()
"configurationRule_var" is a variable referencing a ConfigurationRule object.

#include <Fusion/ConfigurationRules/ConfigurationRule.h>

returnValue = configurationRule_var->toJson();
"configurationRule_var" is a variable referencing a ConfigurationRule object.

returnValue = configurationRule_var.toJson();

Return Value

Type Description
string A JSON object string representing the full rule state.

Version

Introduced in version October 2026