rebu1985 Posted February 28, 2017 Share Posted February 28, 2017 Hi guys, I have done a script to hide some fields of the default PIO 'Desk' because I just need some parameters to work. The plug-in is compiled right but when its not working because nothing is done. My version is VW14. My idea is to create different script for default PIO doors and windows but using a few parameters. My script is below: PROCEDURE Modifydesk; VAR objHd: HANDLE; BEGIN objHd:= GetObject('Desk'); IF objHd=NIL THEN EnableParameter(objHd, 'Leg Height', FALSE); SetParameterVisibility(objHd, 'Leg Height', FALSE); END; RUN (Modifydesk); Quote Link to comment
MullinRJ Posted March 1, 2017 Share Posted March 1, 2017 (edited) 6 hours ago, rebu1985 said: IF objHd=NIL THEN Don't you mean: IF (objHd <> NIL) THEN ? Also, SetParameterVisibility() is not part of the IF statement. You'll need a BEGIN and END to include it. Raymond Edited March 1, 2017 by MullinRJ Quote Link to comment
JBenghiat Posted March 1, 2017 Share Posted March 1, 2017 To start, you have a few issues with your script in general: - Your if statement tests to see if the handle is empty, so your then case only executes if handle acquisition is unsuccessful - You have two statements that are a consequence of your if statement, so you need to put them in an if/then block. Also, the parameter calls are designed to work on a plug-in instance rather than the plug-in default, the latter being the handle you retrieve. The following script will affect the visible parameters of the selected instance of a Desk object: PROCEDURE Modifydesk; VAR objHd: HANDLE; BEGIN objHd:= FSActLayer; IF objHd<>NIL THEN BEGIN EnableParameter(objHd, 'Leg Height', FALSE); SetParameterVisibility(objHd, 'Leg Height', FALSE); END; END; RUN (Modifydesk); A couple other things to note. The OIP needs a refresh, so de-select and re-select the object to see the OIP refresh. These commands are really meant to run from inside the plug-in code, so as soon as you change one of the plug-in’s parameters, the OIP resets to show the field. So, unfortunately, customizing the display options for plug-ins that you don’t code or don’t have that as an explicit feature isn’t possible. -Josh 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.