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?