×
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

How to identify a CATPart / CATProduct ? (VB6)

How to identify a CATPart / CATProduct ? (VB6)

How to identify a CATPart / CATProduct ? (VB6)

(OP)
Hi all,

I am currently working on a macro that "repair" broken links of a product by searching the missing parts in given directories (and recursively subdirectories). The macro is working since the name of the products (or parts) are the same as the name of the files. For example you have in the tree :
Part1 (part1.1)
so the file will be named Part1.CATPart, stored somewhere.

I have cases where this rule ain't true.

So was hoping someone here knows :

- how to straightly identify a CATPart or CATProduct (not by using it's .PartNumber, .Name) but something like a unique reference that would be hidden in the file.

- How to quickly list (in an array) the missing objects of the tree (my method is not very fast on huge assemblies)

If someone is intersted, of course I would be glad to share my code.

Synchrotron

RE: How to identify a CATPart / CATProduct ? (VB6)

Try with this...

CODE -->

Sub CATMain()
  Dim oDocument As Document
  Set oDocument = CATIA.ActiveDocument

  Select Case TypeName(oDocument)
  
Case "ProductDocument"
  
    Dim oProductDocument As ProductDocument
    Set oProductDocument = oDocument
    
    MsgBox "This is a " & TypeName(oDocument)
Case "PartDocument"
   
    Dim oPart As Part
    Set oPart = oDocument.Part

MsgBox "This is a " & TypeName(oDocument)
 Case "DrawingDocument"
 MsgBox "This is a " & TypeName(oDocument)
 Case "AnalysisDocument"
MsgBox "This is a " & TypeName(oDocument)

Case "ProcessDocument"
MsgBox "This is a " & TypeName(oDocument)

Case "CatalogDocument"
MsgBox "This is a " & TypeName(oDocument)

End Select
  
End Sub 

RE: How to identify a CATPart / CATProduct ? (VB6)

(OP)
I'm sorry, I wasn't explicit.

I was not talking of identifying whether the object is a CATPart or CATProduct. I was asking if there is a way to distinguish 2 files with the same name, same partnumber and same product.name, like a Product.IdNumber, which would be unique.

RE: How to identify a CATPart / CATProduct ? (VB6)

(OP)
Thank you. I check this as soon as as I can.

RE: How to identify a CATPart / CATProduct ? (VB6)

(OP)
Okay I've cheked this, and apparently, it is very hard to hav access to the UUID. So I believe I cannot program an auto file seek on missing files in my products (or at least only by checking the product name and comparing it to the file name, which not always the same...)

Am I right ?

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