Node for getting property of Civil Objects

Hi, is there any node for getting this object property? It seems I can’t access it using Object.PropertySets. I’m using Civil 3D 2025.1, thank you

I couldn’t find a node either, however, this might help you get information from the object using the API:

# Load the Python Standard and DesignScript Libraries
import sys
import clr
import traceback

# Add Assemblies for AutoCAD and Civil3D
clr.AddReference('AcMgd')
clr.AddReference('AcCoreMgd')
clr.AddReference('AcDbMgd')
clr.AddReference('AecBaseMgd')
clr.AddReference('AecPropDataMgd')
clr.AddReference('AeccDbMgd')

# Import references from AutoCAD
from Autodesk.AutoCAD.ApplicationServices import *
from Autodesk.AutoCAD.DatabaseServices import *

# Import references from Civil3D
from Autodesk.Civil.DatabaseServices import *

# The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN

adoc = Application.DocumentManager.MdiActiveDocument

# prepare output
res = []

# set input
selection = IN[0]

with adoc.LockDocument():
    with adoc.Database as db:
        with db.TransactionManager.StartTransaction() as t:
            try:
                for dynobj in selection:
                    obj = t.GetObject(dynobj.InternalObjectId, OpenMode.ForRead)
                    if type(obj) == MaterialSection:
                        # properties see: https://help.autodesk.com/view/CIV3D/2023/ENU/?guid=acf87e4e-4beb-6270-7e56-6e25cfa0948f
                        # or res.append(dir(obj)) for full list of the cals props / methods
                        res.append({"Area": obj.Area,"Station": obj.Station})
                        res.append(dir(obj))                       
                    else:
                        res.append(type(obj))
                        
                        
            except:
                err = traceback.format_exc 
                res.append(err)

            pass

# Assign your output to the OUT variable.
OUT = res


2 Likes

Apparently the Area property is inherited and not the value you might expect. You may add:

                        sectionpts = obj.SectionPoints
                        pts = Point3dCollection()
                        for spt in sectionpts:
                            pts.Add(spt.Location)
                        poly = Polyline3d(Poly3dType.SimplePoly,pts,True)
                        res.append(poly.Area)

for every MaterialSection to obtain the area… This gives me the same values as in the properties window.

1 Like

That’s a great question! Before 2025.1 with all the new nodes dropped, you could do something like this, using nodes from the Civil3d Toolkit. This would list all directly available parameters.

As of now, the Civil3d Toolkit hasn’t updated and I’m not sure it will because I don’t think Autodesk will supply two different packages? Here’s a post descriping the status quo.
I hope a dedicated node will be incorperated in the future, until then you might have to use python as @geert.drijfhout provided.

it works, thank you

yes, I also used Civil3D Toolkit before. I hope it will get updated soon. Thank you for the response

Just to point out: I did not manage to get the Area from the Civil3dToolkit GetParameters Node, probably scince it is not a class property of the Material Section.