Search code examples
vbahyperlinkcatia

CATIA V5 VBA: get CATPart linked documents


Is there a way for a catscript/catvbs/catvba to access all the Pointed Documents of a CATPart?

I need to retrieve a list of all the Pointed Documents filepaths (similarly to what an interactive user gets with the menu View-->Edit Links-->Pointed Documents tab)

CATIA V5 Automation seems to expose such APIs only for CATDrawings. For each DrawingView object you can get the Pointed Document with:

PointedDocFullPath = MyDrawingView.GenerativeBehavior.Document.Parent.FullName

But, how can I get CATPart links?


Solution

  • Try CAIEngine and stiDbItems:

    stiEngine = catia.GetItem("CAIEngine")    
    # The GetStiDBItemFromAnyObject() needs a document object as parameter.
    stiDbItem = stiEngine.GetStiDBItemFromAnyObject(product.ReferenceProduct.Parent)
    stiChildren = stiDbItem.GetChildren()
    for i in xrange(1, stiChildren.Count + 1):
      fullPath = stiChildren.Item(i).GetDocumentFullPath()
    

    Good luck