×
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

Catia V5 Rename Partnumbers of Bodies by UserForm

Catia V5 Rename Partnumbers of Bodies by UserForm

Catia V5 Rename Partnumbers of Bodies by UserForm

(OP)
Hello,

First of All, i'd like to thank the person who helped me last time, due to him, i had improuved my Catia Level (sadly, not in english ..)
So i'finish my code, but it still not working, i mean, it fonction but not fully. Can anyone have a look on my code and tell me my errors ?

This userform helps me to fill the proprietes of Bodies

Thx Everyone
Best Regards


Here is my UserFormInterface

- I named the boxes as "TextBox1", "TextBox2", "TextBox3"


here is my code :

CODE --> VBA

Sub CATMain()



Set documents1 = CATIA.Documents

Set partDocument1 = documents1.Add("Part")

Set part1 = partDocument1.Part

Set bodies1 = part1.Bodies

Set body1 = bodies1.Add()

part1.Update

Set body2 = bodies1.Add()


part1.Update

Set body3 = bodies1.Add()

part1.Update

Set body4 = bodies1.Add()

part1.Update

Set product1 = partDocument1.GetItem("Part1")


strPath = "H:\VBA\Project\ProjetVBA1.catvba"
strModule = "modMain"
strProcedure = "CATMain"


UserForm1.Show 0

UserForm1.TextBox1.Value


If UserForm1.TextBox1.Text = "" And _
   UserForm1.TextBox2.Text = "" And _
   UserForm1.TextBox3.Text = "" And _
   UserForm1.TextBox4.Text = "" Then
   

      
Else

End If




End Sub 

RE: Catia V5 Rename Partnumbers of Bodies by UserForm

Hi,

In the picture attached is the body feature properties (right mouse button click on body).

Where do you want to fill those properties ? Did you tried to do it manually first ? Do you want to create some parameters under body or ?

As I remember, Eric recommend you to do a single part1.Update not each time (but this is not the main problem as I can see).

Regards
Fernando

https://picasaweb.google.com/102257836106335725208

RE: Catia V5 Rename Partnumbers of Bodies by UserForm

(OP)
I can do it manually, but i want to made a macro, when i click on it, the "userform" will appear, and i should fill the blanks on the macro and thats will made me 5 "bodies" with the name that i have filled in the "textbox".

RE: Catia V5 Rename Partnumbers of Bodies by UserForm

(OP)
Exactly sir, i just want to rename the new bodies names with a VBA And later if i understand the right working way of macro, i'll add a "line" to catalogue of materials ! But i'm not there ! first of all, i want to rename new bodies

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