How to list/export attached xrefs to excel

Hi all,

I am working in a non-projectwise environment. I need to get a list of all the xrefs, nested or not nested for a set of drawings and into a Excel spreadsheet. Is there an east way to list all this, and then collect and send off the relevant files?

I am using SS4.

many thanks.

Andre

Parents Reply Children
  • try this...It will give a list of all attached references but no full path.

    ' DISCLAIMER
    ' Use of this program acknowledges this disclaimer of warranty:
    ' These programs are supplied as is. Bentley Systems, Inc. disclaims all warranties, express or implied, including,
    ' without limitation, the warranties of merchantability and of fitness of this program for any purpose.
    ' Bentley Systems, Inc., assume no liability for damages direct or consequential, which may result from the use of these program.
    ' We repeat Bentley Systems, Inc. does not warrant these programs.
    ' Use the programs at your own risk.
    Option Explicit
    Sub ReferenceReport()
    Dim folder As String
    Dim parts() As String
    Dim activefilename As String
    Dim outFileName As String
    Dim lvl As Level
    
    parts = Split(ActiveDesignFile.FullName, ".", -1)
    activefilename = parts(LBound(parts))
    outFileName = activefilename & ".csv"
    
    ' On Error Resume Next
    
    Open outFileName For Output As #1
    'Print #1, "Master, Reference Name, Full Path, Attached Model, Display"
    Print #1, "Master, Reference Name, Attached Model, Display"
    
    RefDisplay Nothing, Chr(9)
    ' MsgBox "Report File " + outFileName
    Close #1
    End Sub
    Sub RefDisplay(oattachment As Attachments, tabs As String)
    Dim RefAttachments As Attachments
    Dim att As Attachment
    Dim lvl As Level
    Dim Display As String
    
    If oattachment Is Nothing Then
    Print #1, ActiveModelReference.DesignFile.Name + ","
    Set RefAttachments = ActiveModelReference.Attachments
    Else
    Set RefAttachments = oattachment
    End If
    
    For Each att In RefAttachments
    If att.DisplayFlag = True Then Display = True Else Display = False
    
    
    Print #1, "," + att.AttachName + "," + att.AttachModelName + "," + Display
    RefDisplay att.Attachments, tabs + Chr(9)
    Next
    End Sub

  • more tweaking could be done to open the location, change the location or change the name of the file.