Rename Hole feature with VBScript (Knowledgeware)
Rename Hole feature with VBScript (Knowledgeware)
(OP)
Hello,
I need to rename a Hole feature with VBScript!
So far I can rename everything else (sketchs, points, curves, open bodies, bodies etc.) but features such as pads and holes I can not. In general the script looks like this:
Dim hole1 As Shapes
Set hole1 = shapes1.Item(Hole.1)
hole1.Name = "TEST"
The script editor does not except hole1.Name = "TEST"
I am also able to see the name:
MsgBox "NAME = " & hole1.Name
but I can't rename it!!!
Any ideas?
Chris
I need to rename a Hole feature with VBScript!
So far I can rename everything else (sketchs, points, curves, open bodies, bodies etc.) but features such as pads and holes I can not. In general the script looks like this:
Dim hole1 As Shapes
Set hole1 = shapes1.Item(Hole.1)
hole1.Name = "TEST"
The script editor does not except hole1.Name = "TEST"
I am also able to see the name:
MsgBox "NAME = " & hole1.Name
but I can't rename it!!!
Any ideas?
Chris





RE: Rename Hole feature with VBScript (Knowledgeware)
Sub CATMain()
Set PartDocument1 = CATIA.ActiveDocument
Set Part1 = PartDocument1.Part
Set bodies1 = Part1.bodies
Set body1 = bodies1.Item("PartBody")
Set Shapes1 = body1.Shapes
Set hole1 = Shapes1.Item("Hole.1")
hole1.name = "Test"
End Sub
it works perfectly for V5R12 SP3
bye
Naveen