I just recently started using Microstation 2004 for a new job. I've been trying to find a reliable way to reliably rotate the selected element by set increments using a Macro. For example using F1 would rotate the selected element 1 degree to the left and F2 would rotate it 1 degree to the right. Normally I can figure this kind of thing out for myself but I've had difficulty finding the right documentation. If anyone can point me in the right direction for how to accomplish this or a resource that can effectively explain how to learn to do this I'd be very grateful.Thank you
So here, in 2022, you are just using MicroStation V8 2004? I somehow feel less retro for using V8i SS10 in 2022.
When you talk about Elements, what type of elements are you rotating?
I know, I'm puzzled too but my impression is that another company we rarely do business with uses it for their drafting and we do it just to keep things simple between us. I'm new so I'm just gonna make the best of an unfavorable situation for now and maybe down the road try to figure out a way to get with the times. I miss a lot of the quality-of-life stuff you get with modern programs but I think I can make things bearable if I can script a few things.
I'm not sure about the terminology but I believe I just need to rotate cells and text, to align them more or less perpendicular/parallel to the lines in the drawing. I'm used to working with things like AutoHotkey to speed up my workflow but honestly v8 is so old that AHK doesn't play nice with it (apparently nothing in v8 has a ClassNN) so it's probably just easier to work with Macros within the program itself.
Tristan Jonas said:I've been trying to find a reliable way to reliably rotate the selected element by set increments
It sounds like bad idea, in context of recently shared details.
Tristan Jonas said:using a Macro
From your question, it looks like you think about MicroStation BASIC. Be aware it is obsolete tool, that should not be used for any new code. MicroStation VBA is BASIC successor in MicroStation, offering better tools and API.
Tristan Jonas said:resource that can effectively explain how to learn to do this
What is your current knowledge? To write a macro, to learn the language (VBA) is mandatory first step. To understand MicroStation API and its features is the second one.
There is Learning MicroStation VBA book available and even when it is quite old, it is still useful (especially in context of V8 2004 Edition ;-). But to learn coding is long process.
Tristan Jonas said:I miss a lot of the quality-of-life stuff you get with modern programs
Yes. Even in old and not supported anymore MicroStation V8i, the discussed task can be done even without any coding I guess, only using AccuDraw (even though macro usually can streamline a workflow further).
Tristan Jonas said:to align them more or less perpendicular/parallel to the lines in the drawing
"More or less" ... what is it? It does not sound like engineering definition ;-)
It sounds like to write modification tool, that allows to select an element (or to use Selection set?), define whether mode should be parallel or perpendicular, and to select an element defining the orientation. Is it correct?
But before any learning / coding / analysis start, I recommend to search for available tools. Even when V8 2004 is very old, because of MicroStation VBA compatibility, different scripts and macros can be found, both in wiki and attached to discussions. I recommend to start with Active Angle Assistant.
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
I'm unfortunately hindered by the fact that whenever I try to operate anything involving VBA I get the error message "unable to start visual basic for applications because it is not registered". For whatever reason everyone's copy of MicroStation 2004 at my place of work does this and I don't feel comfortable troubleshooting it because I know VBA is installed and working on the computer just fine, so the problem must be very complex and outside my range of authority on the matter. VBA is the obvious choice but for reasons outside my control I cannot use it. I'm cornered.
Mathematically parallel/perpendicular is obviously ideal but if it's faster to approximate it within a few degrees then I'd prefer to do that.
Tristan Jonas said:I get the error message
Similar VBA problems were discussed many times, you can find some information e.g. in this wiki article.
I would recommend to start MicroStation as ustation.exe /regserver, in DOS shell with elevated (Administrator) rights. You do not share any information what Windows you use, but V8 2004 Edition is not certified for any recent version. Or the installation process was not done right (or other installation corrupted VBA registration in MicroStation).
Tristan Jonas said:so the problem must be very complex
It is interesting: You confirmed you knowledge is limited, but at the same time you know the problem is complex. Isn't there a contradiction? Even when sometimes it requires different test and tries, than the right solution is found, rarely is more complex than to follow some steps.
Tristan Jonas said:but if it's faster to approximate it within a few degrees then I'd prefer to do that.
Sorry, but it is nonsense in my opinion.
It's not a contradiction, I also know that deep space astronomy is complex but I have no knowledge of it.
I am going to have to put my foot down on this in less uncertain terms: I'm not going to attempt to repair MicroStation because I'm new at this company and don't want to risk screwing up the program. Things can go terribly wrong when you try to work under the hood and I'm not risking it, sorry.
Please don't be rude, I'm only asking questions and trying to get help. Please don't call what I'm asking about nonsense.
Tristan Jonas said:I'm not going to attempt to repair MicroStation
I am not sure whether you know, but to use ustation.exe /regserver is far from "repairing", how this term is used for restarting/repeating installation and verification whether everything is fine (which is extensive task).
It is 2 seconds task, and the only requirement is to start DOS shell as administrator (even when sometimes it can be used even without it).
Tristan Jonas said:I'm only asking questions and trying to get help.
I think the answers, posted here, are all the same: Use VBA, because "ready to be used" macros exist and it is supported technology. When you decided to even not try anything how to fix VBA, you remain alone with obsolete, not supported tool, that nobody have used for many years, so it is hard to discuss it and receive answer, because probably only a few people have "active knowledge" of it.
Even on this web there is close to zero information about MicroStation BASIC, because the web itself was established after BASIC for marked as obsolete.
So, without VBA, I do not recall anything I can recommend as solution.
Ok, I'm taking your advice and making an effort in earnest to get VBA to work properly. I tried a few different things but so far nothing seems to work:
Across the board, no dice. Idk if it helps but I'm getting an error that says "VBA interface error: failed creating the APC project - 0x80040154"
Tristan Jonas said:I'm taking your advice and making an effort in earnest to get VBA to work properly
Installing VBA requires Windows administrator privilege, because it modifies the Windows Registry. That MicroStation VBA is not working indicates that it was not installed correctly: I recall that in the days of MicroStation 2004 Edition there was a Prerequisites installation, which I think took care of VBA and other Microsoft stuff. Who has those installation CDs?
Tristan Jonas said:I cannot reinstall the prerequisite pack because I don't have the credentials/authority
If you can't do your job because the software isn't installed correctly, then it's in your employer's interest to remedy that. Ask your manager to invite your IT department to help.
Regards, Jon Summers LA Solutions
Answer Verified By: Tristan Jonas
Yeah that's what I ended up doing and they've offered to work on a solution. Oh well, I tried to do it without involving them but it looks like this issue is bigger than me. Thank you for your answer, I'll mark it as the solution.
I actually managed to get it to work by using input commands like "rotate icon" and stringing them into BASIC. Please exercise more patience when dealing with new users, I'm doing my best here with the cards I'm dealt and saying that I "decided to even not try anything how to fix VBA" is untrue, I know it's hard to not get frustrated with the technical obstructions in place but working with MicroStation 2004 in the year 2022 is not my choice and not a good reason to get frustrated with me. please recognize that sometimes creative solutions are what's needed :)