Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to identify a CATPart / CATProduct ? (VB6) 1

Status
Not open for further replies.

Suncad

Mechanical
Oct 30, 2013
44
FR
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
 
Replies continue below

Recommended for you

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
 
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.
 
Thank you. I check this as soon as as I can.
 
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 ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Top