×
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

Define or open each Part in Product tree

Define or open each Part in Product tree

Define or open each Part in Product tree

(OP)
Hello,

I would like to define each part in product tree structure. I can not find the proper result.

Maybe i could do with selection to select each part in product tree and open.
It could be solved with selection.part.item(i) and startcommad(open in new window). Have any idea how to program that. Please check the code below.

Thank you!

'***************************************************

Sub CATMain()

Dim Product As ProductDocument

On Error Resume Next

Set Product = CATIA.ActiveDocument


Dim aProduct As Product
Set aProduct = Product.Product


Set productDocument1 = CATIA.ActiveDocument



Dim selection1 As Selection

Set selection1 = productDocument1.Selection


selection1.Search "CATProductSearch.Part,all"


For X = 1 To selection1.Count

Dim Part As Part
Set myPart = productDocument1.Parts.Item(X)

selection1.Search "CATProductSearch.Part,all"
Set Part = selection1.Item2(X).Value.ReferenceProduct.Parent.Part

MsgBox Part.Name ' DISPALYS PART NAME

' !!!!!!!!!!!!HERE I WOULLD LIKE TO DEFINE THE PART (LIKE DOUBLE CLICK) !!!!!!!!!!
' or open in new window


Next



End Sub

RE: Define or open each Part in Product tree

(OP)
Thanks for the links ferdo!

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