How to reach link and shape codes in Code Set Style via Python

Hi,
I’m trying to modify a Code Set Style using Python node but I don’t know how to reach link and shape codes.
When I look one of the Code Set Styles of the drawing I se Code Set Style Items, but these are refer to the point code section of the actual Code Set Style. If I add a new item, it appears among the point codes.
But how can I manipulate the link and the shape codes?

CodeSetStyle.dyn (4.6 KB)

Try setting the CodeSetStyle.SubentityStyleType first.
https://help.autodesk.com/view/CIV3D/2024/ENU/?guid=21d46750-9a3b-c19c-2162-a72b3a21cb3a
https://help.autodesk.com/view/CIV3D/2024/ENU/?guid=4b80b5be-6362-1005-8148-6fe0d65faf47

CodeSetStyle.SubentityStyleType = SubassemblySubentityStyleType.LinkType
CodeSetStyle.Add("teszt", styles.LinkStyles[0])
1 Like

Thanks for the support!

I have a further issue, maybe you can solve it as well.

First I loaded the attached CSV file as a pay item file in the QTO Manager. Then I browsed it in the attached DYN file. The Python script generates a new code set style and adds code set style items with the exact pay items. But for some reason, instead of one pay item per each code set style item, it adds several pay items. I think the problem is with the pay item ID format . Maybe the points are disturbing the process and it assumes that each character of the pay item ID is a separate pay item ID.

I tested it with ordinary dynamo script and it looked good, but I’d like to fix the python node version.

I couldn’t upload CSV format, so you need to save as the XLSX to CSV.

tételsor.xlsx (10.2 KB)
Drawing1.dwg (1.0 MB)
CodeSetStyle.dyn (12.8 KB)