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
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
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Hi Jan,
Thanks for the help. To clarify what I am looking for, sorry for not being clearer, I was hoping to get most if not all the information showed in the Models list in MicroStation V8i SS2. In addition to the information that Jose's suggestion will get me: Model Type, 2D/3D, Annotation, and Sheet Name. We will be moving the Cells over to ORD-CE soon and it would be nice to be able to record all the Cell information and be able to track the changes as we make them.
I am somewhat new to the programming side of things and I could use some instructions on how to run your VBA. I have copied the text to a .txt file and have tried to run it through the batch process but it did not work. I have also replaced '.txt' with '.mvba' to the file name and tried to load it through 'mdl load ...' but that did not work either. I am sure I am missing something simple. Thanks a lot!
David Sullivan
Engineering Software Support Engineer
MS V8i SS2 v08.11.07.492
MS ORD-CE v10.09.00.91
Some VBA resources…
Getting Started with Visual Basic
Book: Learning MicroStation VBA
Training: MicroStation VBA Programming Learning Path
Took the liberty to save Jan’s VBA to a MVBA file
ExportModelList.mvba
David Sullivan said: In addition to the information that Jose's suggestion will get me: Model Type, 2D/3D, Annotation, and Sheet Name.
In such case, I think MicroStation VBA is the only solution in V8i, how to collect this information and store them in a file. Especially because Sheet properties are not part of standard model information, but has to be retrieved separately when the model is sheet.
David Sullivan said:We will be moving the Cells over to ORD-CE soon and it would be nice to be able to record all the Cell information and be able to track the changes as we make them.
If ORD is your target platform, it can be easier to do such export in ORD and not in V8i. CONNECT Edition is much better when a summary of information about any type of object (file, model ... elements...) should be displayed:
I's also possible to define own report (it's a bit more limited than standard Details and Properties dialogs).
I am not sure whether and how it can be automated, but for a ferw files, it's pretty simple to export the data manually or to copy and paste them to Excel.
David Sullivan said:I am somewhat new to the programming side of things and I could use some instructions on how to run your VBA.
Leonard provided nice list of resources where you can obtain more information how to work with MicroStation VBA macros.
Jan Šlegr said:It's also possible to define own report
CONNECT Reports are excellent. I've posted some examples.
Regards, Jon Summers LA Solutions
Jon Summers said:CONNECT Reports are excellent.
I mostly agree it's the great feature, but it's not without bugs and I found some scenarios not supported (partially or completely). On the other hand ... they will probably never be spotted by normal user :-)
Regards,
Thank you all so very much for all the information and guidance. I will definitely take a look at all you said and review the training. Thanks again!