Description This function removes a scatter model from multiple surfaces. The surfaces can be either explicitly defined in an array argument or be implied by the array arguments through use of the recursive option. An Update command should be issued after calling this function (doesn't have to be immediately after, but before the script finishes execution) to ensure that the assignments have fully propagated through the object tree.
Syntax count = SetSurfsRemoveScatter( scat, items(), recursive )
Parameters count (Long) Returned number of surface scatter model assignments that were removed. Scatter models are only removed from surfaces. Depending on the construction of the items() array and the use of the recursive option, the number of scatter model removals can be different from the number of items in the items() array.
scat As Long Node number of the scatter model that is being removed.
items() As Long Node number of the items that the scatter model should be removed from. If an item is a surface, then the scatter model is removed from the surface. If an item is not a surface and the recursive argument is set to False, then the item is ignored. If an item is not a surface and the recursive argument is set to True, then the scatter model is removed from any surface which is descended from the item.
recursive As Boolean If True, any surfaces descended from a node in the items() array will have the scatter model removed. If False, the scatter model is only removed if the surface is specified in the items() array.
Example The example below retrieves a list of items which have been assigned the "Design Path" keyword, then removes the Harvey Shack scatter model from each of these items if it is present.
Sub Main
'Construct array of keywords Dim kws(0) As Long kws(0) = KeywordFind( "Design Path" )
'Construct array of items having keywords of interest Dim items() As Long KeywordsGetAppliedItems( "ent", kws(), items() )
'Remove a scatter model if present Dim scat As Long scat = FindScatter( "Harvey Shack" ) SetSurfsRemoveScatter( scat, items(), True )
End Sub
See Also
|