'
' This example illustrates how to search an object construction history
' for a particular operator
'
NewScene , false
set oObject = Application.ActiveProject.ActiveScene.Root.AddGeometry("Sphere","MeshSurface")
ApplyOp "Twist", oObject
ApplyOp "Bend", oObject
ApplyOp "Taper", oObject
' Find all operators reading from the primitive
set oPrimitive = oObject.ActivePrimitive
set oConstructionHistory = oPrimitive.ConstructionHistory
Application.LogMessage "The " & oObject.Name & " has the following operators applied"
for each oOperator in oConstructionHistory
Application.LogMessage vbTab & oOperator.Type
next
set oTwistOperators = oConstructionHistory.Filter( "twistop" )
if oTwistOperators.Count = 1 then
Application.LogMessage "There is 1 twist applied to " & oObject.Name & " and the twist angle is set to " _
& oTwistOperators(0).angle.Value & " degrees"
else
Application.LogMessage "There are " & oTwistOperators.Count & " twists applied to " & oObject.Name
end if
' Expected results:
'INFO : The sphere has the following operators applied
'INFO : secondaryshapemarker
'INFO : animationmarker
'INFO : shapemarker
'INFO : modelingmarker
'INFO : taperop
'INFO : bendop
'INFO : twistop
'INFO : geom
'INFO : There is 1 twist applied to sphere and the twist angle is set to 90 degrees |