The QTO Manager is using the XData to store information - the XData of an object is a collection of ResultsBuffers as a RegisteredApp (Basically an id). A results buffer has two properties - the Value Type (DXFCode) and the Value. Using the following code we can find the Type (don’t forget to import System)
codes = IN[0] if isinstance(IN[0], list) else [IN[0]]
OUT = [System.Enum.GetName(DxfCode, code) for code in codes]
I’m not super au fait with the QTO so I am assuming the integer is some internal type for the QTO. The second string is the Pay Item Id code.
I must apologise for the incorrect multi-code solution - should look like this
I did a bit more digging in the API and it is possible to add and modify Pay Item Ids with the QTOUtility Class which is not implemented as part of the Camber QTO nodes
Example code below with import traceback added to imports
objects = IN[0]
payitemids = IN[1] if isinstance(IN[1], list) else [IN[1]] # string, list of strings
deleteallids = IN[2] # bool
with adoc.LockDocument():
with adoc.Database as db:
with db.TransactionManager.StartTransaction() as t:
output = []
for obj in objects:
try:
id = obj.InternalObjectId
if deleteallids:
QTOUtility.DeleteAllPayItemsIds(id)
for pid in payitemids:
QTOUtility.AddPayItemId(id, pid)
output.append(id)
except:
output.append(traceback.format_exc())
t.Commit()
# Assign your output to the OUT variable.
OUT = payitemids, output
We can we that it adds the last combination of integer (int 2) and the string for the payitem code
Does someone see something not working properly in my printscreen for the for statement why it only passes at the last for looping the information into the list ?
Before i try to switch and use list.map node, i want to give a last chance to what i’ve done until now
I feel like i’m missing something a little detail and it doesnt work
Can you give a look this printscreen, do you see something wrong with my for statement ? (On printscreen just below)
It gives me this result :
And I really just want to generate a list like this (And that’s what the ObjectExtensions.AddXData is excepting)