GisMofx为我提供了这个VBA代码 我使用此代码从我的Catia Part主体中删除指定的符号 你可以帮我把它转换成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
答案 0 :(得分:0)
Did you tried to change FixPartBodyNames with CATMain ?