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
Tristan Jonas said:I've been trying to find a reliable way to reliably rotate the selected element by set increments using a Macro
As Jan advises, prefer VBA to BASIC. Here's some information about MicroStation development languages.
Here's an example text rotation tool written in VBA. Source code is included. You can adapt the code for other DGN element types. You can adapt the code to rotate-by-increment.
Tristan Jonas said:apparently nothing in v8 has a ClassNN
What does that mean?
Regards, Jon Summers LA Solutions
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.
Sorry that's a AHK term, it basically means none of the tool windows in MicroStation V8 have their own "secret" name that's just for the computer to understand the way most modern programs do. It makes it easy to say "look at this text box at this window and return it's value" or "activate this tool within this window" which is how I would usually approach a situation like this when the tech is so old, but can't this time.
Tristan Jonas said:that's a AHK term
Is that Alfred H Knight in Perth?
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.