murx Posted February 9, 2018 Share Posted February 9, 2018 Hello, I am trying to get the Name of an IES File that is attached to a custom light source (for the purpose of an accurate light distribution)which is displayed in the Obj Info Palette. I tried it with GetRField but i cannot get it working. PROCEDURE FindOutParameter; VAR h:Handle; Parametername,Parameternam2:STRING; BEGIN h:=FSactLayer; {Handle to the Lightobject} Parametername:= GetName(h); {That Part works} Parameternam2:= GetRField(h,'Obj Info','Distribution'); {This does not work} AlrtDialog(concat('Name of light: ',Parametername,', ' ,'Name of IES file: ' ,Parameternam2)); END; RUN(FindOutParameter); Can anyone help me please? Quote Link to comment
Pat Stanford Posted February 9, 2018 Share Posted February 9, 2018 You can't get data directly from the OIP. You have to get it from the object parameter record. Your Parameterenam2 line is the right idea, you just have to put in the correct data. I am running for a plane and don't have time to research the field names, but I hove posted a script that will give you that information. Just place a single instance of the object on the active layer, leave it selected and run the script. You will get a worksheet that will list all of the available fields for that object type. Quote Link to comment
murx Posted February 9, 2018 Author Share Posted February 9, 2018 Thank you so much Mister Stanford! Unfortunately my Object is a Light so as you said in the Thread you linked to, it is not working. Do you think there is a possibility to get via Vectorscript to Information from a light that is displayed in the Obj Info Palette? Quote Link to comment
Sam Jones Posted February 9, 2018 Share Posted February 9, 2018 Attached is a script that will list, in a worksheet, the names (universal and local) and their value of a selected object. If there is more than one record attached to the object it will list those records as well. It will not list records attached to embedded objects. The trick is to get the record name and record handle. If if doesn't work for what you are doing, send me the file with the object you want info from selected. Sam List Records and Fields.vs Quote Link to comment
murx Posted February 10, 2018 Author Share Posted February 10, 2018 (edited) 14 hours ago, murx said: Thank you so much Mister Stanford! Unfortunately my Object is a Light so as you said in the Thread you linked to, it is not working. Do you think there is a possibility to get via Vectorscript to Information from a light that is displayed in the Obj Info Palette? Hi Sam, Pat's Script is working very good for Plugin Objects like Doors and such. But, as he said, lights do not seem to be plugin objects. I get: "Parameter Fields for PIO: none" as a result in the Worksheet. Your script produces an error on line 96. It says "Index outside array limits". I was not able to fix that yet but it might be simple. The setup for my file is very simple: it is a single custom light with an .ies file attached to the Distribution in the Obj Info Palette. I want to get the title of the attached .ies file as processable data (string or array or whatever). Since the information is displayed in the Obj Info Palette it must be somewhere, right? I attached the .vwx file and the .ies file. The .ies file is zipped because the file extension is not supported in this forum. Thank you! Max 180210_Query_OIP.vwx info1_info2.ies.zip Edited February 10, 2018 by murx Quote Link to comment
Sam Jones Posted February 10, 2018 Share Posted February 10, 2018 As far as I know, you are out of luck. The "Light" is a parametric object, but it is not listed in the plug-in manager, and calling the "GetParametricRecord(obj) function yields a "NIL". So, it seems VS cannot get a handle to the "Light" record; that means it cannot list the fields of the "Light" record that is attached to the light object. Maybe someone else has a trick, but it is likely that a "Light" object can only be touched by the SDK in C. Quote Link to comment
Hippocode Posted February 11, 2018 Share Posted February 11, 2018 (edited) A light object is not a parametric object, thus any data is not saved into a record. Instead, everything is saved as object properties. You can find the appropriate constants in the SDK definitions. Search for ovLight. It could be that just like in the SDK, VS also has wrapper functions available. Edited February 11, 2018 by Hippocode Quote Link to comment
murx Posted February 12, 2018 Author Share Posted February 12, 2018 Sam and Hippocode, thank you very much for your effort, time and advice! If i find something i will post it here. 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.