×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Rename Hole feature with VBScript (Knowledgeware)

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

RE: Rename Hole feature with VBScript (Knowledgeware)

hi,
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources