RoboDK Forum
Folder Custom Parameters- Printable Version

+- RoboDK Forum (//www.sinclairbody.com/forum)
+-- Forum: RoboDK (EN) (//www.sinclairbody.com/forum/Forum-RoboDK-EN)
+ - - -论坛:通用RoboDK问题(//www.sinclairbody.com/forum/Forum-General-questions-about-RoboDK)
+--- Thread: Folder Custom Parameters (/Thread-Folder-Custom-Parameters)



Folder Custom Parameters-ANDY_F1-08-10-2021

Hi,

Can you help find the command to add custom parameters to a folder within the station?

regards
Andy


RE: Folder Custom Parameters-Albert-08-10-2021

Hi Andy,

This update means that RoboDK can keep binary data assigned to a folder. This is usually accomplished using the API. For example:
Code:
from robolink import *
from robodk import *

# Start the RoboDK API
RDK = Robolink()

# Create the folder
folder_id = RDK.Command("AddFolder", "MyFolder")

# Automatically create the item given its id
folder = Item(RDK, folder_id)

# Print the folder name
print(folder.Name())

# Assign custom binary data to the folder
# This should always be of type bytes (not string)
mydata1 = b'my byte array'
folder.setParam("MyData1", mydata1)

# Retrieve your custom binary data. This always returns your custom byte array.
mydata1 = folder.getParam("MyData1")
print(mydata1)

for i in range(5):
RDK.AddFrame("My Frame " + str(i+1), folder)
You can also set a special RoboDK parameter using setParam and strings. This has a specific behavior defined by RoboDK.
Code:
folder.setParam("Tree", "Collapse")
You can selectTools-Run script-ShowCommandsto see the available RoboDK commands and item parameters you can set.