Hello everyone,
I'm trying to retrieve the link (path or reference) of a 2D Component Instance that comes from a 2D catalog in a CATIA Drawing using VBA.
Here's a snippet of my current code:
Sub CATMain()
Dim catia1 As Object
Set catia1 = CATIA.ActiveDocument
Dim myviews As Object
Set myviews = catia1.Sheets.Item(1).views
Dim mycomp As Object
Set mycomp = myviews.Item(3).components
Dim links1 As String
Set links1 = mycomp.Item(1).CompRef.GenerativeBehavior.Document.Reference.FullName
Debug.Print links1
End Sub
However, this line throws an issue because the 2D Component Instance is not linked to a Part or Product, but instead comes directly from a 2D catalog.
Has anyone encountered this situation?
Is there an alternative method to retrieve the source (path or catalog reference) of the 2D Component Instance?

I'm trying to retrieve the link (path or reference) of a 2D Component Instance that comes from a 2D catalog in a CATIA Drawing using VBA.
Here's a snippet of my current code:
Sub CATMain()
Dim catia1 As Object
Set catia1 = CATIA.ActiveDocument
Dim myviews As Object
Set myviews = catia1.Sheets.Item(1).views
Dim mycomp As Object
Set mycomp = myviews.Item(3).components
Dim links1 As String
Set links1 = mycomp.Item(1).CompRef.GenerativeBehavior.Document.Reference.FullName
Debug.Print links1
End Sub
However, this line throws an issue because the 2D Component Instance is not linked to a Part or Product, but instead comes directly from a 2D catalog.
Has anyone encountered this situation?
Is there an alternative method to retrieve the source (path or catalog reference) of the 2D Component Instance?
