×
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

Count Part Number in a product

Count Part Number in a product

Count Part Number in a product

(OP)
I everyone,

i need a macro to count the part numbers (the diferent ones), that a CATProduct as. My idea is to use this to when add a new component to a Product, automatically the PartNumber as its number.

RE: Count Part Number in a product

Hi,

I suggest you to use something like

Set productDocument1 = CATIA.ActiveDocument
Set selPN = productDocument1.Selection
selPN.Search "CATAsmSearch.Part.PartNumber='" & input & "',all"

MsgBox " Number of Selected Elements " & CATIA.ActiveDocument.Selection.Count

Maybe it will help you. I'm not so sure because for me is not so clear what you want at the end. If you want to rename instances in the catproduct you can search the forum for a macro.

Regards
Fernando

https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...

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