Jump to content

How to get Parameters from the Obj Info Palette


murx

Recommended Posts

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?

Link to comment

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.

 

 

Link to comment

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?

Link to comment

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

Link to comment
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 by murx
Link to comment

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.

Link to comment

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 by Hippocode
Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...