SamIWas Posted July 20, 2022 Share Posted July 20, 2022 Is there a way to create collapsible sections in the OIP for a PIO object, such as in the door object shown in the image? Or is that something available only through the SDK? I have a PIO that I have written which has a lot of different sections, and it can get confusing without a visual divider of sorts. I would love to be able to collapse unused sections. Quote Link to comment
Jesse Cogswell Posted July 20, 2022 Share Posted July 20, 2022 @_c_ Had some success with this in Python. The same idea should carry over in Vectorscript since the Python implementation just adds a vs. prefix to the Vectorscript commands. Quote Link to comment
SamIWas Posted July 21, 2022 Author Share Posted July 21, 2022 4 hours ago, Jesse Cogswell said: @_c_ Had some success with this in Python. The same idea should carry over in Vectorscript since the Python implementation just adds a vs. prefix to the Vectorscript commands. Oof....I feared that this might require event enable. That is just something I have not wrapped my head around yet. Maybe one day... Quote Link to comment
Vectorworks, Inc Employee Julian_Carr Posted July 21, 2022 Vectorworks, Inc Employee Share Posted July 21, 2022 Yes it requires an event enabled PIO. Here is a code snippet: CONST kWidgetGroupMode = 81; kWidgetSeparator = 100; kWidgetGroupAutomatic = 2; VAR gb1 : BOOLEAN; gb1 := SetObjPropCharVS(kWidgetGroupMode, Chr(kWidgetGroupAutomatic)); gb1 := vsoAddWidget( 1, kWidgetSeparator, 'MY FIRST GROUP' ); gb2 := vsoAddParamWidget(2, 'ParamName1', 'Actual Param Name 1 to Display in OIP'); gb2 := vsoAddParamWidget(3, 'ParamName2', 'Actual Param Name 2 to Display in OIP'); gb2 := vsoAddParamWidget(4, 'ParamName3', 'Actual Param Name 4 to Display in OIP'); gb1 := vsoAddWidget( 5, kWidgetSeparator, 'MY SECOND GROUP' ); gb2 := vsoAddParamWidget(6, 'ParamName4', 'Actual Param Name 4 to Display in OIP'); gb2 := vsoAddParamWidget(7, 'ParamName5', 'Actual Param Name 5 to Display in OIP'); gb2 := vsoAddParamWidget(8, 'ParamName6', 'Actual Param Name 6 to Display in OIP'); Additionally you could add vsoWidgetSetIndLvl(8, x ); if you wanted to further indent one of the parameters, where X = 1 or 2 or 3 being how far it is indented. 1 Quote Link to comment
SamIWas Posted July 24, 2022 Author Share Posted July 24, 2022 On 7/20/2022 at 11:06 PM, Julian_Carr said: Yes it requires an event enabled PIO. Here is a code snippet: CONST kWidgetGroupMode = 81; kWidgetSeparator = 100; kWidgetGroupAutomatic = 2; VAR gb1 : BOOLEAN; gb1 := SetObjPropCharVS(kWidgetGroupMode, Chr(kWidgetGroupAutomatic)); gb1 := vsoAddWidget( 1, kWidgetSeparator, 'MY FIRST GROUP' ); gb2 := vsoAddParamWidget(2, 'ParamName1', 'Actual Param Name 1 to Display in OIP'); gb2 := vsoAddParamWidget(3, 'ParamName2', 'Actual Param Name 2 to Display in OIP'); gb2 := vsoAddParamWidget(4, 'ParamName3', 'Actual Param Name 4 to Display in OIP'); gb1 := vsoAddWidget( 5, kWidgetSeparator, 'MY SECOND GROUP' ); gb2 := vsoAddParamWidget(6, 'ParamName4', 'Actual Param Name 4 to Display in OIP'); gb2 := vsoAddParamWidget(7, 'ParamName5', 'Actual Param Name 5 to Display in OIP'); gb2 := vsoAddParamWidget(8, 'ParamName6', 'Actual Param Name 6 to Display in OIP'); Additionally you could add vsoWidgetSetIndLvl(8, x ); if you wanted to further indent one of the parameters, where X = 1 or 2 or 3 being how far it is indented. Hmmm...thank you. I will have to look into this. I have the entire plug-in working. Does changing it to event-enabled change how any of the rest of it operates, or will the standard code still run just fine, while these new portions affect the OIP? Quote Link to comment
Miguel Barrera Posted August 19, 2022 Share Posted August 19, 2022 I have coded something similar to what you want. Several years ago, I faced the same problem where I had a lot more fields than I could display. Although all my plugins are event enabled I came up with this solution before there was event enabled plugins so I do not think it is required. In the following you will see buttons for each section. When you click on each, it will display more fields under it. In the example below, the button "Pole & Foundation" displays a few fields and the button "Ped Push Button" displays only one. When clicked on each of these, they display all the fields associated with each button. The concept is to keep a hidden field with the state of each button. 0 for closed and 1 for open. When setting the field visibilities, I hide the filed if the button is 0 or display the field if the button has a value of 1. In the example below, there are 7 buttons. On the left they are "closed" so the state value is 0000000. When I click on the first, it displays all the fields. When I change the value on the second button from "none" to "2", it displays the fields under that button. The state value is consequently 1100000 Quote Link to comment
SamIWas Posted August 22, 2022 Author Share Posted August 22, 2022 On 8/18/2022 at 8:29 PM, Miguel Barrera said: I have coded something similar to what you want. Several years ago, I faced the same problem where I had a lot more fields than I could display. Although all my plugins are event enabled I came up with this solution before there was event enabled plugins so I do not think it is required. In the following you will see buttons for each section. When you click on each, it will display more fields under it. In the example below, the button "Pole & Foundation" displays a few fields and the button "Ped Push Button" displays only one. When clicked on each of these, they display all the fields associated with each button. The concept is to keep a hidden field with the state of each button. 0 for closed and 1 for open. When setting the field visibilities, I hide the filed if the button is 0 or display the field if the button has a value of 1. In the example below, there are 7 buttons. On the left they are "closed" so the state value is 0000000. When I click on the first, it displays all the fields. When I change the value on the second button from "none" to "2", it displays the fields under that button. The state value is consequently 1100000 That looks fantastic and would work well. But I am not aware of any button field defined in the Vectorscript field options. And man, I really wish that texture field brought up a texture picker, or the color brought up a color picker. So many things that could be done! Quote Link to comment
Miguel Barrera Posted August 24, 2022 Share Posted August 24, 2022 Yes, the buttons can only be created with an event enabled script, Sorry, I am so use to them that I overlooked this fact. See Object events , example 3, for the button creation. But the code could work with a field that can register the change such as a check box. Quote Link to comment
SamIWas Posted August 26, 2022 Author Share Posted August 26, 2022 On 8/23/2022 at 9:47 PM, Miguel Barrera said: Yes, the buttons can only be created with an event enabled script, Sorry, I am so use to them that I overlooked this fact. See Object events , example 3, for the button creation. But the code could work with a field that can register the change such as a check box. Thank you @Miguel Barrera and @Julian Carr. I have been working with the examples you've given for the past couple of days trying to figure out event-enabled scripts and what all the little widget things do and how they interact with other things. To say they are a whole different animal from standard Vectorscript is an understatement. I've been coding in Vectorscript for many years, but Event-Enabled is truly turning my mind into spaghetti. I'm always amazed at the sheer lack of examples for things like this that aren't more than very simple, single-action scripts. Something I could reverse-engineer. I shall keep plodding on in my journey. 1 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.