GisMofx 为我提供了这个 VBA 代码。
我使用此代码从我的 Catia 零件主体中删除指定的符号。
你能帮我把它转换成 CATScript 或 Vbscript 吗?
Sub FixPartBodyNames()
Dim myPart As Part
Set myPart = CATIA.ActiveDocument.Part
Dim myBody As Body
Dim newName As String
Dim newCharacter As String
newCharacter = " "
For Each myBody In myPart.Bodies 'loop through all the bodies in the part
newName = myBody.Name 'get the current body's name
newName = Replace(newName, ".", newCharacter) 'replace all "." with " "
newName = Replace(newName, "/", newCharacter) 'replace all "/" with " "
myBody.Name = newName 'rename the current body with the revised name
Next
MsgBox "All Done!"
End Sub