Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Currently running a rule that I found through the forums to add a prefix text and suffix to the solid body's. Im not great at writing out code minus some iLogic stuff I can figure out. Was looking for a way that could search for the added text to the solid bodies, and delete it.
So say the bodies list was like:
LE
RE
Backer
Nailer
Door
Run the code below and it say something like
CB_LE_5523
CB_RE_5523
CB_Backer_5523
CB_Nailer_5523
CB_Door_5523
So would need something that would delete the added text.
in case others might want that code to rename as well:
Dim oDoc As PartDocument = ThisDoc.Document Dim oDef As PartComponentDefinition = oDoc.ComponentDefinition Dim oSolid As SurfaceBody Dim oSolidName As String Dim oPrefix As String = InputBox("Provide a prefix for each solid. If error, keep undoing untill names are back to original:", "Solid Body Prefix","") Dim oSuffix As String = InputBox("Provide a suffix for each solid. If error, keep undoing untill names are back to original:", "Solid Body Suffix","") 'iterate through all solids and rename if default For Each oSolid In oDef.SurfaceBodies oSolidName = oSolid.Name oSolid.Name = oPrefix & oSolidName & oSuffix Next oSolid
Solved! Go to Solution.