Description This command sets the name of an entity without the need for a T_ENTITY data structure.
Syntax SetName entNode, entName
Parameters entNode As Long Node number of the entity whose name is being set.
entName As String Name to be given to entNode.
Example The following example loops over entities on the object tree and looks for surfaces which have gratings applied. If any are found, the surface name and description are reset.
Sub Main
'Loop over entities on tree Dim curEnt As Long Dim curName As String For curEnt = 0 To GetEntityCount()-1 If IsSurface( curEnt ) Then If IsDiffractingSurface( curEnt ) Then 'Entity is both a surface AND a grating curName = GetName( curEnt ) curName = curName & " Grating" SetName( curEnt, curName ) SetDescription( curEnt, "Diffraction grating surface" ) End If End If Next curEnt Update
End Sub
See Also
|