Hi All,
I'm working with BRCM and using item browser to quickly extract some information about equipments in the model but in most of the cases it takes a long time due to the fact that default settings for tree manager make the item browser scan for items in all refernces and discover all item types.
So I'm wondering if there is any chance to set up this options using vba by the time the file is open so when I need to use the item browser it will load almost inmediately.
I have contacted support and they advice me to use macro recording to reproduce all the steps but the code produced is very simple and only opens the item browser but it doesn't change any options. By the way vba and basic macro recording produce almost the same code.
Here the code produced by macro recording (basic):
Sub main Dim startPoint As MbePoint Dim point As MbePoint, point2 As MbePoint ' Start a command MbeSendCommand "MDL KEYIN Bentley.ECUISupport,ECUISupport EC BROWSE" End Sub
To make it more clear, these are the options I need to change:
Thank you in advance.
Rodrigo
Hi Rodrigo,
btw, what product is BRCM?
Regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Ok, using Google, I guess it's Bentley Raceway and Cable Management. I guess the most of reads are not aware this product even exists and it's abbreviated name is not widely known.
Rodrigo Cortés said:Here the code produced by macro recording (basic):
Do not use MicroStation BASIC macro recorded! It's obsolete technology, not supported in V8i version (and maintained only fore backward compatibility, not migrated to CE).
When you need to record actions (even when it does not help in the discussed case), use MicroStation VBA and related recorder.
Rodrigo Cortés said:So I'm wondering if there is any chance to set up this options using vba
Unfortunately not, this tool has no key-ins and does not support any interaction with MicroStation VBA.
Rodrigo Cortés said:but in most of the cases it takes a long time due to the fact that default settings for tree manager make the item browser scan for items in all refernces and discover all item types.
What happens, when you change the repository setting (to not include references etc. as you requested) and press Save in Tree Manager?
The configuration should be saved to active DGN file, so when you will use this stool for the next time, the updated settings should be used.
Of course it does not solve the problem of default settings for new models, but I guess it's acceptable to open it in a slower way once, for the first time.
I'll follow your advice next time and put the whole product name.
Thanks for your quick reply Jan,
Jan Šlegr said:Do not use MicroStation BASIC macro recorded! It's obsolete technology, not supported in V8i version (and maintained only fore backward compatibility, not migrated to CE).
It was advised by support team to do it that way, I know BASIC is old but didn't know that is was not migrated to CE, good to know.
Jan Šlegr said:Unfortunately not, this tool has no key-ins and does not support any interaction with MicroStation VBA.
Ok, so VBA is not the way to go. I will try to see if it is possible using .net, I've been porting some macros to .net so I have a little of experience. Could you point me somewhere to start? Navigating the object browser for Bentley.ECSystem.2.0.dll and Bentley.ECObjects.2.0.dll I found the Bentley.ECObjects.Standards.ItemsBrowserTreePresentation class but I have no idea on how to use it. I also found the Bentley.ECSystem.Repository.RepositoryConnection class which I think is more related to my issue because I'm dealing with a repository connection.
Jan Šlegr said:What happens, when you change the repository setting (to not include references etc. as you requested) and press Save in Tree Manager
The first time I get an error:
But then, if I press save button again the changes are saved, so I suppose that this is the "standard behavior" of the software.
As you mention it solves the problem but I wouldn't be here if I didn't believe there is a better way of achieving this.