ApplyGenOp

Introduced

4.0

Description

Applies a generator operator and returns the newly created operator(s). (A generator operator is an operator which creates new geometry, such as the Loft, CrvStitch, and SrfFillet operators.) The newly generated objects are also available via one of the following methods:

(1) Use the output argument OutputObjs (only available for VBScript because most languages cannot cope with both an output argument and a return value--see the note below).

(2) Use Operator.OutputPorts first on the output operator and then use Port.Target2 on an item of the returned collection (as demonstrated in the JScript example below.

Warning: If you use the OutputPorts/Target2 method of getting the newly generated objects, remember that you can only access the output ports on an operator if it was applied in persistent mode (ie., don't freeze it until you get a pointer to the target object).

You can also use the generic ApplyOp command to apply a generator operator; however, if you want to hide or delete the input objects (original geometry) or you want the new geometry to be a polymsh, you must use this command.

Note: This command uses output arguments. C# and some scripting languages (such as JScript, PerlScript and Python) don't support arguments passed by reference. Normally you can get the output arguments via either XSIApplication.ExecuteCommand method (C#) or the ISIVTCollection (scripting languages), but this command already returns a value.

The only available workaround in this case is to create a VBScript custom command which returns both the output arguments and the return value in one array. For details, see What Happens when the Function Already Returns a Value?.

Scripting Syntax

ApplyGenOp( PresetObj, [Target], [ConnectionSet], [ConnectType], [ImmediateMode], [GenOpInputsDisposal], [OutputObjs] )

Parameters

Parameter

Type

Description

PresetObj

String or a preset object (see SIGetPreset)

Generator Operator Presets

Target

String

Geometry type of the output surface for the following surface-from-curves types of operators:

"Birail", "CrvNet", "Extrusion", "ExtrusionAlongAxis", "ExtrusionTwoProfiles", "FourSided", "Loft", "Revolution", and "RevolutionAroundAxis"

Default Value: NurbsSurface

Possible Values:

MeshSurface: Mesh surface geometry

NurbsSurface: Nurbs surface geometry

ConnectionSet [in/out]

ConnectionSet

Specifies the objects connected to an operator. See Operator Presets for details on the connection set required for the specific operator you are using.

Note: Because this is an in/out parameter, any string (variable or value) you pass into this parameter is automatically converted to a ConnectionSet.

Default Value: Currently selected objects are used as the main group.

 

Warning: An error occurs if the connection set is invalid. Please verify the connection set required for the

operator you are using to avoid breaking your scripts.

 

ConnectType

siBranchFlag

Specifies the type of connection (node or branch).

Default Value: siUnspecified

ImmediateMode [in/out]

siOperationMode

Specifies whether or not the operator should be immediately frozen.

Default Value: siPersistentOperation

GenOpInputsDisposal [in/out]

siGeneratorInputsDisposalMode

Specifies what to do with the input objects after the operation is performed.

Default Value: siKeepGenOpInputs

Possible Values:

siKeepGenOpInputs: The inputs will be kept

siHideGenOpInputs: The inputs will be hidden

siDeleteGenOpInputs: The inputs will be deleted

OutputObjs [out]

XSICollection

Returns a collection of X3DObject object(s) created by the generator operator.

Return Value

Returns an XSICollection that contains the newly created operators.

Note: If you apply the operator in ImmediateMode (which immediately freezes it), you still get a collection of the operators applied, but they are invalid (not connected to anything in the scene).

See Also

ApplyOperator

ApplyOp

ApplyTopoOp

ApplyHairOp

Generator Operator Presets

 

 

 

Examples

• See ApplyGenOp.1.js

• See ApplyGenOp.2.vbs

• See ApplyGenOp.3.vbs



Autodesk Softimage 2011