Logic Machine Forum
Object Vis. Parameters - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Object Vis. Parameters (/showthread.php?tid=2374)



Object Vis. Parameters - BrentW - 03.12.2019

Hi,

I'm hoping someone could assist me in finding how to change the vis. parameters of an Object.

Currently I am using grp.create to create the group but ultimately I would like to set the following via a resident script.

- Control Type
- Decimal Places
- Min Value
- Value Display

Furthermore,
I would like to be able to add groups to the Tag Map via script. Any help is greatly appreciated.

Thanks in advance,
Brent


RE: Object Vis. Parameters - admin - 03.12.2019

You need to add visparams key to grp.create configuration parameters. Visparams is a Lua table where keys depend on object data type. You can check values by logging objects or inspecting database backup. Tags can be passed as a Lua table as well: https://openrb.com/docs/lua.htm#grp.create


RE: Object Vis. Parameters - BrentW - 09.12.2019

(03.12.2019, 08:07)admin Wrote: You need to add visparams key to grp.create configuration parameters. Visparams is a Lua table where keys depend on object data type. You can check values by logging objects or inspecting database backup. Tags can be passed as a Lua table as well: https://openrb.com/docs/lua.htm#grp.create
Hi admin,

Could you elaborate any on the visparams and and how it is implemented? 

Kind Regards, 
Brent


RE: Object Vis. Parameters - Erwin van der Zwart - 10.12.2019

Hi,

Just create 1 object with the desired params and perform a log of this object by log(grp.find('1/1/1'))

In the log you can see how you need to reproduce the fields automatically.

BR,

Erwin


RE: Object Vis. Parameters - admin - 11.12.2019

Example:
Code:
grp.create({
  address = '0/0/1',
  datatype = dt.bool,
  name = 'test',
  visparams = {
    control = 'checkbox'
  },
})