Is there a way to batch rename entities?
For example, I am working with a complex machined part and having to parse it into smaller portions for effective meshing. At this point, I have a few hundred new solids entitled "Sliced Body". I would like to be able to rename whole blocks of these to keep better track of them. I realize I could have just renamed them as they were created, but this would have taken the same amount of time overall to just doing it after the fact.
Solved! Go to Solution.
I wrote an API that renames the selected solids by prompting for a prefix name and it will take all the selected solids and append ": n" title, where n starts at 1.
The HTML Clipboard
Sub Main Dim App As femap.model Set App = feFemap() Dim rc As Long Dim ss As femap.Set 'Set of selected solids Set ss = App.feSet Dim s As femap.Solid Set s = App.feSolid Dim sid As Long Dim sname As String rc = ss.Select ( FT_SOLID, True, "Select Solids for Renaming" ) If rc = 2 Or ec = 4 Or ss.Count = 0 Then App.feAppMessage ( FCM_HIGHLIGHT, "No solids selected") GoTo EndMacro End If Begin Dialog UserDialog 300,140,"Title for Selected Solid(s)" ' %GRID:10,7,1,1 text 20,20,260,25,"Enter Title or Title Prefix for Solid(s)",.solidName_Text,2 TextBox 20,60,260,20,.solidTitle_TextBox OKButton 20,100,100,30 CancelButton 180,100,100,30 End Dialog Dim dlg As UserDialog Dialog dlg sname = dlg.solidTitle_TextBox ss.Reset sid = ss.First For i = 0 To ss.Count-1 s.Get ( sid ) s.title = sname + ":" + Str$(i+1) s.Put ( sid ) sid = ss.Next Next EndMacro: App.feViewRegenerate ( 0 ) End Sub