JMiller Posted January 27, 2002 Share Posted January 27, 2002 Does anyone know of the syntax neccesary to access the parameters of a plug in object and use them as variables in Vector Script. Specificly, I would like to access (both read and write into variables) the parameter fields in the "Lighting Device" object in VWSpotlight. Thanks in advance, Jason Quote Link to comment
Hannes Posted January 27, 2002 Share Posted January 27, 2002 Hello Jason, ***to read parameters: FUNCTION GetRField ( h :HANDLE; record :STRING; field :STRING ) :DYNARRAY[] of CHAR ; Description:Returns string description of a value in the specified record field. Parameters:h: Handle to object. record: Name of record format. field: Name of field to be queried. Result:Returns the field value as a variable length string. +++++++++++++++++++++++++++++++++++++++++++++To set parameters use PROCEDURE SetRField ( h :HANDLE; record :STRING; field :STRING; value :DYNARRAY[] of CHAR ) ; Let me know if you have any problem with this and i'll send you a example. [ 01-27-2002: Message edited by: Hannes ] Quote Link to comment
Hannes Posted January 28, 2002 Share Posted January 28, 2002 quote: Jason Miller asked:... Am I able to access the parameters within this object without getting the variable names inside the script of the plug in object? Yes you are able to do this. Here is a example: Insert a Simple 'Window Object 2' into your drawing and run the attached Script.I assume you use VW 9? If not then tell me and i'll modify the script to work on a VW 8's PIO. Kind Regards,Hannes*********************************************Procedure ChangeParameter;{Example which gets and sets the Width parameter of aselected Simple Window 2.} VARh:Handle;Parametervalue:String;NewParametervalue:String; Beginh:=FSactLayer; {<<<handle to the Pluginobject} Parametervalue:=GetRField(h, 'Simple Window 2', 'Width'); {<<<get the width parameter. note thatyou have to use the native parametername, not the alternate. In this example: the Width parameter is shownin the Objectinfo as 'Unit Width' but the real parametername is 'width'. (look into the Plugin's Properties to find the proper names} AlrtDialog(Concat('the width of the simple Window is: ',parametervalue)); NewParametervalue:=StrDialog('Set new width: ',Parametervalue); SetRField(h, 'Simple Window 2', 'Width', NewParametervalue);{<<<set the new value} SetClass(h,Getclass(h)); {<<<this is necessary to redraw the object after changing the parameter value} END; Run(ChangeParameter); 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.