LarryO

Index of Events - Where is it found??

5 posts in this topic

Other than pouring through the examples to extract the typical event index numbers,

where does one find a complete list of the predetermined event indices?

I could not find the list in the vectorscript appendices.

Or have I got the concept wrong and these are all constants which the script must define as required?

In which case I should be seeking out a list of constants used for event tracking.

 

Will an error be generated if your button ID is the same as another event? (newbie question :-)

Share this post


Link to post

The event codes are found in the Vectorworks SDK documentation. You would have to download the SDK and dig around there to find them all.

 

But that is probably not useful as very few of the events are accessible.  Check out the article on VectorLab for more information.  http://www.vectorlab.info/index.php?title=Events

Share this post


Link to post

In order to parse the events, you will need to call

 vsoGetEventInfo(
               outObjEvent    :;
               outEventData   :);

the first variable is the event number, and the second is additional info on the event. In the case of a button hit, the second variable will be the button id that you assigned when the button was created so there is no error generated if the button has the same id as an event. As a practice however, I do start buttons in the 1001 range to avoid any conflict with buttons defined in vectorworks.

 

Share this post


Link to post

Thanks guys for the starter info.

I read through that vectorlab posting and the sdk manual. I tried a few snippets from the examples, but this is getting messier than I anticipated. It would seem that parameter visibility functionality is related to the index number of the parameters in the parameter dialog and not the parameter name. Leads to some strange/complex behaviours when populating the OIP and the order of the parameters is altered in the parameter dialog, particularly if button placement is not the last OIP item. I am concerned that all the extra code required to track and maintain consistency of appearance in the OIP is going to bog down the user experience if many instances of my PIO are placed in the drawing environment.

 

All I really wanted was a two state button, depressed / not depressed, that doesn't resemble a check box. ie: a boolean that looks like a button with the alternate name showing up on the button. I easily figured out how to reset the boolean at the end of the PIO script, but changing its appearance to make it appear more intuitive (like a push button switch) stumped me.

Share this post


Link to post

That level of UI modification isn't possible, and the buttons are generated by the OS, not image based.  Generally, they are designed for things like opening a dialog or forcing a refresh.  The checkbox is going to be your best UI option.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now