matteoluigi Posted October 26, 2020 Share Posted October 26, 2020 Hi, I try to put out some Info via the message bar. (i actually am thinking about some kind of progress bar) Unfortuntately their doesn't appear any text in the message bar... any ideas? (it's the first example script from the developer-page) 😉  Quote PROCEDURE FirstExample; CONST   kGREETING = 'Hello '; VAR   MyMessage : STRING; BEGIN   myMessage:='Script';   Message(kGREETING);   Wait(5);   SysBeep;   ClrMessage; END; RUN(FirstExample);  Quote Link to comment
Nicolas Goutte Posted October 26, 2020 Share Posted October 26, 2020 1 minute ago, matteoluigi said: Hi, I try to put out some Info via the message bar. (i actually am thinking about some kind of progress bar) Unfortuntately their doesn't appear any text in the message bar... any ideas? (it's the first example script from the developer-page) 😉    Even in C++-Code, it can happen that you do not see the text if VW has no time to draw it. Quote Link to comment
Pat Stanford Posted October 26, 2020 Share Posted October 26, 2020 The Message command "stopped working" a few versions ago in that it does not operate during a Vectorscript, but only at the end of the script. At least that is my memory. Â You can either use AlrtDialog, and require the user to hit enter to proceed. (this is my go to for debugging) Or you can try AlertInform and set it to be a minor alert. The problem with that is the second time you call AlertInform it ignores the Minor and pops up a dialog box instead of just putting the information into the message bar. Â If you really feel you need a progress indicator you might be better off in Python and use Python objects instead of VW objects. Â +1 to @JBenghiat ;-) Quote Link to comment
JBenghiat Posted October 26, 2020 Share Posted October 26, 2020 Message is floating palette, not the message bar. Currently, Message usually won't display until after the script runs. It can be useful for quick debugging. Â There are a number of built-in routines for showing a progress bar dialog. You can also show alerts in the message bar with AlertInform(), but only if the user has opted to display minor alerts i the message bar (you could get and save the preference, set the preference to show minor alerts, and then restore). 2 Quote Link to comment
Sam Jones Posted October 26, 2020 Share Posted October 26, 2020 Actually, the Message command is still working, badly. Â Typically, it will fail to deploy if there are any alerts or dialogs in the command that you are running. Â It is not reliable to code. Â That is if you have no alerts or dialogs the message window may still not deploy; however, if you see it deploy when running a command, it will be consistent for that command (unless you edit and change it). Â I have several commands that use the message window to show options to use while a command is running, but I have to check them with every new version of VW. Quote Link to comment
matteoluigi Posted October 27, 2020 Author Share Posted October 27, 2020 14 hours ago, Pat Stanford said: you might be better off in Python yeah, that's what a friend already recommended me to do from the beginning. 😉 I think I have to rewrite my script in python asap. Quote Link to comment
matteoluigi Posted October 27, 2020 Author Share Posted October 27, 2020 14 hours ago, Pat Stanford said: The Message command "stopped working" a few versions ago btw, the first in the introduction of vector script is basing mainly on the Message-command. I'm sure, the page hasn't been touched for a rather long time, however, a quite unsatisfying "first script" for beginners ;-). Quote Link to comment
JBenghiat Posted October 28, 2020 Share Posted October 28, 2020 The message box hasn’t stopped working, it just doesn’t update until the end of the script. For quick debugging, where you just need to display a single value or result, it still works great. It definitely won’t work for a progress indicator, though.  python won’t really help you in this case either. Your options are still using the progress dialog or having a minor alert in the message bar. In general, though, unless you’re already very familiar with VectorScript, I recommend working with python. Quote Link to comment
matteoluigi Posted October 28, 2020 Author Share Posted October 28, 2020 @JBenghiat pity, my script still is rather slow, so i wished i could install a progress bar to pacify all possible impatient colleagues 😉 Quote Link to comment
JBenghiat Posted October 28, 2020 Share Posted October 28, 2020 Any particular reason you don't want to use the progress dialog? https://developer.vectorworks.net/index.php/VS:Progress_Dialog  1 Quote Link to comment
matteoluigi Posted October 28, 2020 Author Share Posted October 28, 2020 (edited) 6 minutes ago, JBenghiat said: Any particular reason you don't want to use the progress dialog? a very convincing reason: i still didn't know of the existence of that command/function 🙈  thank you! 🙂 Edited October 28, 2020 by matteoluigi Quote Link to comment
SamIWas Posted November 2, 2020 Share Posted November 2, 2020 On 10/26/2020 at 1:26 PM, Pat Stanford said: The Message command "stopped working" a few versions ago in that it does not operate during a Vectorscript, but only at the end of the script. At least that is my memory.  You can either use AlrtDialog, and require the user to hit enter to proceed. (this is my go to for debugging) Or you can try AlertInform and set it to be a minor alert. The problem with that is the second time you call AlertInform it ignores the Minor and pops up a dialog box instead of just putting the information into the message bar.  If you really feel you need a progress indicator you might be better off in Python and use Python objects instead of VW objects.  +1 to @JBenghiat 😉  So THAT'S why so many of my scripts don't report what they used to. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.