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
Find the attached VBA which scans for the reference files and reports it to a CSV file which can be opened in Excel.The report file is written to the same location where the DGN file resides and the file name is <DGN FileName>.csve.g. if the file name is Test.dgn the report file name is Test.csv
RefFileNameReport.zip
Check these links...Getting Started with Visual BasicBook: Learning MicroStation VBATraining: MicroStation VBA Programming Learning Path
does it handle nested refs and list out the sub refs?
Lorys
Started msnt work 1990 - Retired Nov 2022 ( oh boy am I old )
But was long time user V8iss10 (8.11.09.919) dabbler CE update 16 (10.16.00.80)
MicroStation user since 1990 Melbourne Australia.click link to PM me
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.
thank you for the file. appreciate it.