Hello everyone! I'm currently trying to automate the use of the Label Display tool in Bentley Facilities Planner. My goal is to create a script that I could batch run in several files to achieve the mentioned labelling.
I'm using Microstation CONNECT Edition.
I have experience with VBA Macros in Office and LISP in AutoCAD but I'm knew to programming in Microstation so any kind of guidance would be much aprecciated.
Should I use VBA Macros or something else?
How can I find the right commands to automate the use of this tool?
Thank you in advance.
Best Regards
Allow me to explain a bit further what I want to accomplish. I wish to create a script to label the rooms of several files according to a template. The general goal is to have each room in each of the files labelled with a room stamp (Microstation Cell/AutoCAD Block) cointaing information of the rooms. This files I will later convert into DWG files. I have created a script to take text files inside polygons in AutoCAD (AutoLISP) and create the room stamps (AutoCAD Blocks with attributes), but for this I need to import the information for each room via labelling as text objects inside the polygons before DWG conversion. Once I achieve this I was also thinking about creating the room stamps entirely in BFP to avoid the use of AutoCAD. What are your thoughts on this? Am I on the right track? Any help would be much aprecciated.
Allow me to explain a bit further what I want to accomplish.
I wish to create a script to label the rooms of several files according to a template. The general goal is to have each room in each of the files labelled with a room stamp (Microstation Cell/AutoCAD Block) cointaing information of the rooms. This files I will later convert into DWG files.
I have created a script to take text files inside polygons in AutoCAD (AutoLISP) and create the room stamps (AutoCAD Blocks with attributes), but for this I need to import the information for each room via labelling as text objects inside the polygons before DWG conversion.
Once I achieve this I was also thinking about creating the room stamps entirely in BFP to avoid the use of AutoCAD.
What are your thoughts on this? Am I on the right track? Any help would be much aprecciated.
Hi Federico,
Federico Arroyo said:trying to automate the use of the Label Display tool in Bentley Facilities Planner.
I recommend to move your question to OpenBuildings forum, because this is MicroStation Programming forum and your question is about specific Facilities Planner tool. To move existing discussion, use More > Move tool available under your original post.
I also recommend to read and follow the best practices, especially to exactly specify product and its version (e.g. using build number).
Federico Arroyo said:but I'm knew to programming in Microstation so any kind of guidance would be much aprecciated.
You do not specify the version you use (V8i or CONNECT Edition), but in general, you can find some tutorials on Internet:
... and of course, it's worth to read MicroStation help as well as MicroStation VBA help, both delivered together with all MicroStation based products.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Hi Jan,
Thank you for your reply. I have duly changed the topic to the forum suggested and added some more information in the question.
Not sure what kind of labeling you need, but there are two interesting VBAs that you may be interested in.
1. Import Points CE, which takes a list of points in excel format and places a Cell accordingly.
2. PokeIt, which searches for Mstn elements.
You could modify item 2 to select the elements you want to label, extract their centerpoints then use item 1 to place Cell with your label.
SpacePlanner - if it is using the Datagroup System, you should also be able to use the OBD DG Annotation Rules.
Hi Dominic,
Thank you for your answer. The tool I mentioned is the Labelling Tool which is available in BFP
communities.bentley.com/.../displaying-labels-for-areas-and-assets
I'm looking to automate the use of it. Is that possible?
Thanks!
Hi Frederico,
Federico Arroyo said:I'm looking to automate the use of it. Is that possible?
the problem is that tool is specific to Planner, so it's not clear (at least for us, MicroStation users ;-) how it's implemented: Especially what elements are used and whether it can be accessed by other tools.
The simplest way how to test automation options is to try to record VBA macro. CONNECT Edition platform offers ability to record mbr (simple script) or VBA code (which is better in this case).
Regards,
Thank you for your answer Jan. I recorded a Macro when trying to use the mentioned tool. I basically opened the tool and opened a labelling template and run it and only got the following line at the VBA code:
' Send a keyin that can be a command string CadInputQueue.SendKeyin "DMSG ACTIVATETOOLBYPATH Display\Label Display"
What do you think? How could I continue?