0

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
4

1 回答 1

0

您是否尝试使用 CATMain 更改 FixPartBodyNames ?

于 2016-02-12T22:05:13.467 回答