Export Model List

Good Morning All,

Is there a way to export the list of all the Models in a V8i SS2 .dgn file?

I just want to be able to easily record all the Models in a file for documentation, to keep track of edits and other possible administrative tasks. It would be very helpful for managing Cell Libraries too. Thanks.

God bless,

David

Parents
  • Hi David,

    it's not clear what information you would like to record (model name onlyu, anything else?) and what level of automation is required (manuall, key-in, batch process...). Jose's advice is the best in my opinion for manual export, which maybe is enough for you. MicroStation V8i (SELECTseries 2) does not provide any reporting functionality.

    An alternative solution when an automation is required (e.g. to record models from more models in batch process) is to use MicroStation VBA macro. I found (and modified a bit) some my older code (I guess I created it for some training ;-)

    Option Explicit
    
    Const outputFolder = "D:\temp\"
    
    Public Sub SaveListOfModels()
        
        Dim outputFileNum As Integer: outputFileNum = 1
        Dim outputFile As String: outputFile = ConstructExportFileFullPath
        
        Open outputFile For Append As outputFileNum
        
        SaveListOfModelsToFile outputFileNum
        
        Close outputFileNum
    
    End Sub
    
    Private Sub SaveListOfModelsToFile(fileNum As Integer)
    
        Dim model As ModelReference
        
        For Each model In ActiveDesignFile.Models
            Print #fileNum, model.Name
        Next
    
    End Sub
    
    Private Function ConstructExportFileFullPath() As String
    
        Dim activeDesignFileName As String: activeDesignFileName = ActiveDesignFile.Name
        Dim exportFileName As String: exportFileName = outputFolder & activeDesignFileName & ".txt"
        ConstructExportFileFullPath = exportFileName
    
    End Function
    

    With regards,

      Jan

Reply
  • Hi David,

    it's not clear what information you would like to record (model name onlyu, anything else?) and what level of automation is required (manuall, key-in, batch process...). Jose's advice is the best in my opinion for manual export, which maybe is enough for you. MicroStation V8i (SELECTseries 2) does not provide any reporting functionality.

    An alternative solution when an automation is required (e.g. to record models from more models in batch process) is to use MicroStation VBA macro. I found (and modified a bit) some my older code (I guess I created it for some training ;-)

    Option Explicit
    
    Const outputFolder = "D:\temp\"
    
    Public Sub SaveListOfModels()
        
        Dim outputFileNum As Integer: outputFileNum = 1
        Dim outputFile As String: outputFile = ConstructExportFileFullPath
        
        Open outputFile For Append As outputFileNum
        
        SaveListOfModelsToFile outputFileNum
        
        Close outputFileNum
    
    End Sub
    
    Private Sub SaveListOfModelsToFile(fileNum As Integer)
    
        Dim model As ModelReference
        
        For Each model In ActiveDesignFile.Models
            Print #fileNum, model.Name
        Next
    
    End Sub
    
    Private Function ConstructExportFileFullPath() As String
    
        Dim activeDesignFileName As String: activeDesignFileName = ActiveDesignFile.Name
        Dim exportFileName As String: exportFileName = outputFolder & activeDesignFileName & ".txt"
        ConstructExportFileFullPath = exportFileName
    
    End Function
    

    With regards,

      Jan

Children