Struggling to create a propertySet and add it to objects

Howdy! I want to create a Property for objects I create, but for some reason I am having issues. I am running Civil3d 2024, Dynamo v.2.19.4 © 2023.

In order to add a PropertySetDefinition I need to access the dictionary of said definitions within the document. I tried These code snippets without success.

from Autodesk.Aec.PropertyData.DatabaseServices import *
from Autodesk.Aec.PropertyData import *

And then:

PropSetDefDictName = "AecDbPropertySetDefinitions"
NOd = tr.GetObject(db.NamedObjectsDictionaryId, OpenMode.ForRead)
psd_dict = tr.GetObject(NOd.GetAt(PropSetDefDictName), OpenMode.ForRead)

Or:

PropSetDictionary_id = PropertySetDefinition.GetPropertySetDefinitions(db)
(then get dictionary with id, and find the property set I want within it or if it exists)

All of these fail. I also tried an approach of looking for the objects first, and if the list is empty, then I try to create the definition. But this node itself errored out

Basically, what is the right approach to create, and then add a propertyset to objects I make? the AI has not given me stuff that works. Thank you!

I guess you are trying to get an object by an existing property set with your nodes right now. Try this within C3D v2025 or v2026 to create property sets (it might be in the civil nodes package).

Or this within C3D 2023 and 2024, I think. You will need external packages, I believe, which might be Camber and the Civil 3D toolkit. It’s been a while since I used those…