Using Virtual Reality (VR) from Python API

Hello,
I am Paula and I have been working with Visual Components for a while. I am trying to program a A* algorithm in Python trying that a UR3e is capable of moving blocks from a firt state to an end state and I am having some problems. The first thing is, I have created some blocks from Python and I am changing its properties:
app = getApplication()
name = ‘Block1’
block = app.findComponent(name)
#If it doen’t exit, we create it:
if block == None:
# Using URI:
block = app.load(‘file:///C:/…/Cube.vcmx’)
block.Name = nombre
block.CubeLength = 16
block.CubeWidth = 32
block.CubeHeight = 9.6

That works, but now, I want to modify the properties of a DeviceController and I have tried to do the same but with this method I just can modify Default properties and I want to indicate from Python, wich components can be Pickables in VR.

Have someone achieved this? Or does someone knows if it is possible to do that or not?

Best regards, Paula.

To set a part as VR pickabable, all you need is to create a new boolean property in that part. The property name needs to be “VrPickable” and the value must be True.

example:
vr_pickable_property = some_component.createProperty(VC_BOOLEAN, “VrPickable”)
vr_pickable_property.Value = True

1 Like

Hello,

Thank you so much! It works.

Best regards, Paula.

1 Like