| in_name | Command scripting name. | |
| in_args | Array of values containing the arguments to pass to the command. Because this argument is defined as const, the array cannot be updated with the output argument values returned by the command. You should use the other version of ExecuteCommand defined with a CValueArray& argument if you need to access the output argument values. | |
| io_val | The value returned by the command. |
CStatus::Fail failure
| in_Preset | Filename of preset |
CStatus::Fail is returned in case of failure
using namespace XSI; // Forward declaration void CreateOverridePreset ( const CString &in_presetFile, Application &in_App ); Application app; // NewScene command CValueArray cargs; CValue oarg; cargs.Add( L"" ); cargs.Add( false ); app.ExecuteCommand( L"NewScene", cargs, oarg ); cargs.Clear(); // Preset file path CString presetFile = app.GetInstallationPath( siUserPath) + L"/Data/DSPresets/Properties/Override.Preset"; // Create and save an override preset CreateOverridePreset(presetFile, app); //Add cube geometry and create the reference model Model root = app.GetActiveSceneRoot(); X3DObject myCube, myCone; root.AddGeometry( L"Cube", L"MeshSurface",L"",myCube); // CreateModelAndConvertToRef command CString strFactPath = app.GetInstallationPath(siProjectPath) ; strFactPath += L"/Models/MyModel.emdl"; cargs.Add( myCube.GetFullName() ); cargs.Add( strFactPath ); app.ExecuteCommand( L"CreateModelAndConvertToRef", cargs, oarg ); cargs.Clear(); Delta myDelta; // AddDelta command cargs.Add( L"Model" ); app.ExecuteCommand( L"AddDelta", cargs, oarg ); cargs.Clear(); // Add the override from preset myDelta = oarg; myDelta.AddOverrideFromPreset ( presetFile ); //This function create the preset that is going to be add to the Delta void CreateOverridePreset ( const CString &in_presetFile, Application &in_App ) { Model root = in_App.GetActiveSceneRoot(); X3DObject myCube; root.AddGeometry( L"Cube", L"MeshSurface",L"",myCube); // CreateModelAndConvertToRef command CString strFactPath = in_App.GetInstallationPath(siProjectPath) ; strFactPath += L"/Models/MyModel.emdl"; CValueArray cargs; CValue oarg; cargs.Add( myCube.GetFullName() ); cargs.Add( strFactPath ); in_App.ExecuteCommand( L"CreateModelAndConvertToRef", cargs, oarg ); cargs.Clear(); // AddProp command cargs.Add( L"Synoptic Property" ); cargs.Add( myCube.GetFullName() ); cargs.Add( L"" ); in_App.ExecuteCommand( L"AddProp", cargs, oarg ); cargs.Clear(); // SetValue command cargs.Add( myCube.GetFullName() + L".Synoptic_Property.displayname"); cargs.Add( L"TestName" ); in_App.ExecuteCommand( L"SetValue", cargs, oarg ); cargs.Clear(); // SavePreset command cargs.Add( L"Model.Delta.PropertiesAddedToRefModel" ); cargs.Add( in_presetFile ); in_App.ExecuteCommand( L"SavePreset", cargs, oarg ); cargs.Clear(); // NewScene command cargs.Add( L"" ); cargs.Add( false ); in_App.ExecuteCommand( L"NewScene", cargs, oarg ); cargs.Clear(); }
CStatus::Fail is returned in case of failure
using namespace XSI; Application app; // NewScene command CValueArray cargs; CValue oarg; cargs.Add( L"" ); cargs.Add( false ); app.ExecuteCommand( L"NewScene", cargs, oarg ); cargs.Clear(); //Add cube geometry and create the reference model Model root = app.GetActiveSceneRoot(); X3DObject myCube; root.AddGeometry( L"Cube", L"MeshSurface",L"",myCube); // CreateModelAndConvertToRef command CString strFactPath = app.GetInstallationPath(siProjectPath) ; strFactPath += L"/Models/MyModel.emdl"; cargs.Add( myCube.GetFullName() ); cargs.Add( strFactPath ); app.ExecuteCommand( L"CreateModelAndConvertToRef", cargs, oarg ); cargs.Clear(); Delta myDelta; // AddDelta command cargs.Add( L"Model" ); app.ExecuteCommand( L"AddDelta", cargs, oarg ); cargs.Clear(); myDelta = oarg; // Add an action of type siModificationDeltaStaticValue ActionDelta myDeltaAction = myDelta.AddAction(siModificationDeltaStaticValue); // Add the Static value item ActionDeltaItem myActionDeltaItem = myDeltaAction.AddStaticValueItem ( myCube.GetFullName() + L".kine.global.posx", 10.0); // AddProp command cargs.Add( L"Synoptic Property" ); cargs.Add( myCube.GetFullName() ); cargs.Add( L"" ); in_App.ExecuteCommand( L"AddProp", cargs, oarg ); cargs.Clear(); myDelta.RemoveOverride(); myDelta.RemoveAction(siModificationDeltaStaticValue); // UpdateReferencedModel command cargs.Add( L"Model" ); app.ExecuteCommand( L"UpdateReferencedModel", cargs, oarg ); cargs.Clear(); myDelta = oarg;
in_nbLocatorsToBeQueried is present. | target | Object to be connected to the port. | |
| name | Port name. | |
| insertat | Port index within group. | |
| flags | Mask of input port flags described by siPortFlags. |
| pst | The returned status code, returns CStatus::OK for success. |
| target | Object to be connected to the port. | |
| name | Port name. | |
| insertat | Port index within group. | |
| flags | Mask of output port flags described by siPortFlags. |
| pst | The returned status code, returns CStatus::OK for success. |
| target | Object to be connected to the port. | |
| name | Port name. | |
| insertat | Port index within group. | |
| flags | Mask of port flags described by siPortFlags. |
| pst | The returned status code, returns CStatus::OK for success. |
| in_preset | The filename or full path to a Preset file. | |
| in_bBranch | True to apply property on the branch of object. | |
| in_name | The name of the new Property object. |
| out_prop | The new Property object. |
| in_scriptname | The script name of a parameter. |