Getting complete sheet field expression from Sheetsetmanager

I am setting up a Dynamo script for working with Sheetsetmanager in Civil 3D, I need to extract the complete field expression for all my sheets within sheetsetmanager. I have set up the following nodes which select the .dst file and then opens the sheetsetmgr database and unwraps it by using object.identity nodes:

From here I have a sheetset.sheets node connecting to another object.identity.

Once I extract the data using object.identity from the data base and the object.identity from sheetset.sheets I feed it into two python scripts for diagnostics.
The first python code is as follows:

sheets = IN[0]  # From SheetSet.Sheets
sheetSetDb = IN[1]  # From SheetSet.ByDatabase

diagnosticInfo = {
    "SheetSetProperties": [],
    "SheetProperties": [],
    "SheetSetType": str(type(sheetSetDb)),
    "SheetType": str(type(sheets[0]) if sheets else "No sheets")
}

# Get SheetSet properties
try:
    sheetSetProps = []
    for attr in dir(sheetSetDb):
        if not attr.startswith('_'):
            try:
                value = getattr(sheetSetDb, attr)
                if not callable(value):
                    sheetSetProps.append(f"{attr}: {type(value).__name__}")
            except:
                sheetSetProps.append(f"{attr}: <error accessing>")
    diagnosticInfo["SheetSetProperties"] = sheetSetProps[:20]  # First 20 properties
except Exception as e:
    diagnosticInfo["SheetSetProperties"] = [f"Error: {str(e)}"]

# Get Sheet properties  
if sheets:
    try:
        sheetProps = []
        sheet = sheets[0]  # Just check first sheet
        for attr in dir(sheet):
            if not attr.startswith('_'):
                try:
                    value = getattr(sheet, attr)
                    if not callable(value):
                        sheetProps.append(f"{attr}: {type(value).__name__}")
                except:
                    sheetProps.append(f"{attr}: <error accessing>")
        diagnosticInfo["SheetProperties"] = sheetProps[:20]  # First 20 properties
    except Exception as e:
        diagnosticInfo["SheetProperties"] = [f"Error: {str(e)}"]

OUT = diagnosticInfo

and the second is:

sheets = IN[0]  # One or more unwrapped sheets (from Object.Identity)
props = []

sheet = sheets[0] if isinstance(sheets, list) else sheets

for attr in dir(sheet):
    if not attr.startswith('_'):
        try:
            val = getattr(sheet, attr)
            props.append(f"{attr}: {val}")
        except:
            props.append(f"{attr}: <error>")
OUT = props

The problem is that unwrapping the database does not give me the componentId for the sheets which is what i need as the complete field expression which I want to set up from all the extracted data should follow something down the line of: %<\AcSm Database(“C:...dst”).SheetSet(“gXXXX”).Component(“gYYYY”).Number \f “%tc1” \href “C:...Test.dwg#,Test##1”>%

How can I get the complete extracted field expression for each sheet that exists in my sheetsetmanager?

@DawidM Did you ever get this figured out some how? I am trying to do the same thing and running into problems.

I have not, doing further research on it and seems like you would need to build a custom node that does that. Once I have it working, I will update the post.

Woow, i’ve never knew nobody so brave to use Sheet Set Manager! :face_with_tongue:

Just joking, i’ve never used because i found it very complicated to use precisely for this issue it uses filds, and that is practical but dificult to support and lose the link when you migrate your Title to a second .dwg because in a new .dwg the title pasted is now a new object, best way to find the good field expresion is manually, you edit your attributes in your Title, and in the textbox you make righ click and choose edit field, you can explore all the expresions in this menu, how to acces those since Dynamo not sure for real!

in my opinion Autodesk has a big oportunity to improve this and make it friendly, instead to make it complicated, just give te users the oportunity to create Custom Paramaters to Layouts, and then the users can create Titles with Labels that shows the value of this current Layouts Parameters values, that exist in Revit with Sheet Parameters and it works perfect, you just simply create a Sheet List and you have a table to edit the data in the title, easy and friendly! :winking_face_with_tongue: is just a tought!

I’m not sure how you’ve been doing that to where it breaks every time you take the title block to a new sheet, but the way this works when used correctly solves that exact issue.

When you setup your title block to use the CurrentSheetNumber or CurrentSheetTitle (or any Current Sheet variable) then that data references the information directly from the Sheet Set for the sheet you’re in. If you are not adding that drawing layout to your sheet set, that would be the only reason it doesn’t work.

What you describe with Revit can be done with Sheet Set Manager, but it does take a little extra work and manual data entry. The sheet set is just a feature that was packaged into AutoCAD, and doesn’t have any internal knowledge of your model like Revit does. AutoCAD is too broad of a tool for that but I do agree that it would be nice to have some additional built in parameters.

yeha you’re rigth perhaps i’ve never take the time to set up properly, the fact that is an external file and can manage multiple layouts in multiple files is an advantage is true, but also a point of failure because if you don’t have acces to the sheet set the link with the information is broken, similar when you sent your file with out the xref, could happen, i prefer that the information belongs to the file itself, personally i’m not really fan of sheet set, so you’ve said that it’s posible to add attributes or parameters to the layouts? have you the link for the documentation product, that’s sounds super intresting!! :smiley: