Search - User list
Full Version: Python create attribute
Root » PDG/TOPs » Python create attribute
zhaoxijiucao
beginner for TOPs

I wanna know how to add attribute for each index,for example,I have a string array,and i wanna gave array element for each index.

Help pls
tpetrick
You can use a Python Script node to set string array attributes. For example:

work_item.setStringAttrib("name", "value", 0)
work_item.setStringAttrib("name", "other_value", 1)
work_item.setStringAttrib("name", "third_value", 2)

If you're on 18.0, you'll probably want to set the Evaluate Script During parameter to “Generate” as well, so the attributes are created during the work item generation step.
zhaoxijiucao
tpetrick
You can use a Python Script node to set string array attributes. For example:

work_item.setStringAttrib("name", "value", 0)
work_item.setStringAttrib("name", "other_value", 1)
work_item.setStringAttrib("name", "third_value", 2)

If you're on 18.0, you'll probably want to set the Evaluate Script During parameter to “Generate” as well, so the attributes are created during the work item generation step.
Sir,Hou.attribype.global can be translate what type of PDG attributr?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB