I've looked all over the internet for some documentation regarding the writing of UCM files, but alas, I cannot find anything!
We're currently using MicroStation SE, so I believe the best (if not only) way of having this coding, is to use the UCM files.
Does anyone have any documentation or user guides for writing or understanding UCM coding? I'm currently trying to work out what APCOLS, APTSCL, FBFDCN, CUGRAF and NULCMD all mean.
Any help would be gratefully received, as this is becoming a bit of a pain!
pjpops said:Does anyone have any documentation or user guides for writing or understanding UCM coding?
Anyone who admits to knowing that stuff is likely to keep quiet about it. Either that, or they retired many years ago.
Take Jan's advice: move to BASIC. Why ... ?
pjpops said:I'm currently trying to work out what APCOLS, APTSCL, FBFDCN, CUGRAF and NULCMD all mean.
... that's why. UCMs are hard to read. They are terse, inflexible, lack documentation, and once written are an archtypical example of write-only code.
BASIC includes a macro recorder. That will give you a helping hand to get going.
pjpops said:We're currently using MicroStation SE
Presumably you're stuck with MicroStation SE for a good reason?
pjpops said:Hopefully we'll get V8i soon
V8i provides Microsoft Visual Basic for Applications (VBA). VBA is even better than BASIC. If you start writing BASIC in SE, you'll be pleasantly surprised at what you'll be able to achieve with VBA.
On the other hand, UCMs, while supported in V8i, don't provide access to areas of MicroStation. You'll remain stranded, programatically speaking, in the 1980s (which is when UCMs originated).
Regards, Jon Summers LA Solutions
We're basically stuck with SE due to budgeting and the cost implications of introducing V8i across the company.
It would be good to use BASIC, but I'm currently working out how to edit .bas files and even how to assign them to toolbars. There seems to be very little help for using SE (rightfully so, as it hasn't been supported by Bentley for quite some time now!), so this is proving fairly tricky.
I will endeavour to try and work out some BASIC coding, but at the moment, I'm finding it hard to find much documentation which starts at the basics.
Thanks again for your help guys and wish me luck!
caddcop said: I am neither retired nor unwilling to admit I actually enjoyed working on UCM's!
You're a brave man, Chuck! I have enough trouble keeping up with today's technologies.
Thank you so much for that pdf, it's exactly what I was after!
At least I'll be able to work out what some of the coding actually means now.
Am I right in thinking that the .bas files will work ok in v8i? If not, would it be easy to convert them to VBA?
Thanks again for your help Jon, you've really helped in my understanding.
While basic is supported, it is no longer in development, which means more and more things in MicroStation cannot be dealt with in it. So VBA is the way to go, but you won't have VBA available until you move to V8.
The conversion of a UCM to either basic or VBA will be pretty manual. Understanding what is in the UCM is important, if you want to preserve all of its features. But sometimes, it is easier, once you understand it, to record a macro (basic or VBA) while you step through the process that the UCM expects. Sadly, you cannot run a UCM and record it and get much information (if it works at all) but that snippet you posted looks like it may create an object and then pattern it. So you can do the same as you record the steps.
Often, it will indicate some interaction with the tool settings. Usually, these can be replaced with a direct input of some type of design file setting and are more efficient and easier to follow than the cryptic code generated when using the tool settings or other dialog boxes.
If a ucm created a graphic group out of its elements, this is equally easy in basic or VBA and there should be some examples out there to copy. Also, you need to see how to ask the user for input and then how to use that input. Again, look through the examples.
Finally, ucm's always had to sequence commands. Basic macros also have to sequence command. VBA can sequence commands, but you can create what amounts to your own commands where the very complex graphics you are creating are displayed dynamically as the command is running. But before you jump into that level, you need to get comfortable with the basics.
We have SE through V8i here at work. A handful of old projects are still in V7 file format. I have setup a project that allows someone to work on those files in V8 (any version) while keeping them in V7 and not only does it work, but when I was assigned a new laptop, I told them to leave V7 off.
It is a good way to get users into V8, and you into VBA for these tools.
Charles (Chuck) Rheault CADD Manager
MDOT State Highway Administration
pjpops said:Am I right in thinking that the .bas files will work ok in v8i?
They may work. MicroStation BASIC has been left to atrophy. For example, BASIC doesn't handle levels particularly well in V8 (but still that's better than UCMs, which don't handle levels at all in V8).
pjpops said:Would it be easy to convert from BASIC to VBA?
BASIC is, well, basic, compared to VBA. I think that anything you can do with BASIC is reasonably straightforward to convert to VBA. Somethings are so much easier in VBA, but handled differently, that a straightforward conversion from BASIC to VBA is not always the best way.
That said, it's going to be easier to convert to VBA from BASIC than from UCMs.
Let me put this another way.
Whether you write UCMs or BASIC today, you have to learn a new technology.
Does that make it easier to choose one over the other?
I think it may be time to drag out MicroStation support person out of the dark ages and in to the 21st century!
I'll get my head around BASIC coding and then make the change to VBA once we have v8i.
I've been having a play around with macros and I'm liking the way that it actually records your inputs, rather than having to guess what the UCM wants you to input and try to learn from your mistakes!!
Thanks again for your help guys, it really has helped an awful lot!