For anyone who liked using the old docls.ma application in Microstation v8i, I obtained an old vba file from another forum member which functioned very similar to the mdl application. I believe Linienstileplazieren.mvba was written by Artur Goldsweer from Bentley back in 2006. I tested the vba in CONNECT and it worked for the most part.
The mdl version would place a line using each line style available within the active workspace and place the name of the line style at the end of the corresponding line element. Using the vba, the line elements were placed, but the style name was not being placed.
I modified the vba so the style name is placed to the left of each line element. I also modified the Text Height to 0.01 (compatible with our files using annotation scale). Since the test is being placed to the left of the line element, I added a line to adjust the justification of the active test style to Right Center. I added a line to reset the text style at the end.
One big issue with the mdl version was the lines were stacked pretty tightly and you had to spend a lot of time separating the elements. The vba worked much better, but I also increased the spacing between each element so, if you adjust the annotation scale, there is less chance of overlapping.
I discovered the text was not being placed because the line of code sending the text to the keyin browser was incorrect. Originally it was CadInputQueue.SendCommand oLinst.Name. Changing .SendCommand to .SendKeyin resolved the issue.
Anyhow, I wanted to post the vba file here in case anyone is interested in using it.DocumentLineStyles.mvba
The vba has been updated by Artur Goldsweer when I submitted a service ticket for an issue with UNC paths not supported. He kindly updated the vba to remove the keyins. Here is the updated version
8524.DocumentLineStyles.mvba
Microstation CONNECT - 10.17.2.61
ORD - 2021 R1 10.10.1.3
ORD 2022 R1.1 - 10.11.3.2
ORD 2022 R3 - 10.12.2.4
Microstation v8i SS 10 - 08.11.09.919
Power InRoads v8i - 08.11.09.615
ProjectWise - 10.0.3.453
Answer Verified By: Robert Hook
Thank you VERY MUCH for updating this! I use it all the time, and now I can almost get rid of V8i? LOL
FWIW here's a way to create a legend that requires no programming...
Regards, Jon Summers LA Solutions
Question, does this work when linestyles come from a DGNLIB?
MaryB
Power GeoPak 08.11.09.918Power InRoads 08.11.09.918OpenRoads Designer 2021 R2
MaryB said:Question, does this work when linestyles come from a DGNLIB?
I believe it does.