Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

CATVBA to get Links of Document

Status
Not open for further replies.

Jegsaran

Automotive
Dec 16, 2020
42
Good day to everyone!!
I am using Catia V5, for one of my project I need to get the link type of all elements in the links of document window as shown in the below snip.

Links_of_Document_ckvq5u.png


I'm able to get the linktype for elements where pointed document is there using the below code.
But for items which doesn't have pointed documents, I'm unable to fetch the data.

Code:
    Dim stiEngine As stiEngine
    Dim stiDbItem As stiDbItem
    Dim StiChildren As Object
    Dim S As String
    Set stiEngine = CATIA.GetItem("CAIEngine")
    Set stiDbItem = stiEngine.GetStiDBItemFromAnyObject(partDoc)
    Set StiChildren = stiDbItem.GetChildren()
    For i = 1 To StiChildren.count
        Dim linkType 'As CATBSTR
        linkType = StiChildren.linkType(i)
    
        S = StiChildren.Item(i).GetDocumentFullPath()
        Debug.Print "Attribute Link " & i & ": " & linkType & "Path: " & S
    Next i

Any help on this is highly appreaciated.

Thanks in advance.
 
Replies continue below

Recommended for you

Hi Jegsaran-San.

Here is a VBA sample, but it is for VBA 32-bit, so you will need to modify it for 64-bit.
Link
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor