Studio A International, LLC's Blog

Programming, BIM automation, and advanced AEC technology notes

Technical discussions on Revit API programming, custom AEC software, C#, Python, BIM workflows, domain-specific small language models, quantum computing, and related technologies for the architecture, engineering, and construction industry.

Revit API | C# | Python

Creating Revit Sheets with the Revit API, C# or Python

A practical introduction to automating Revit sheet creation using C# or Python via Revit API.

Concept & Process

Revit sheets can be created programmatically using a .xlsx file that holds the information for the sheet number, sheet name and title block. In this blog post we will explore how this works.

using Autodesk.Revit.DB;

ViewSheet sheet = ViewSheet.Create(doc, titleBlockId);
sheet.SheetNumber = "A-101";
sheet.Name = "Floor Plan";

Revit API | C# | Python

Creating Revit Shared Parameters with the Revit API, C# or Python

A practical introduction to automating Revit Shared Parameters creation using Python or C# via Revit API.

Concept & Process

If you ever wanted to create automatically Revit Shared Parameters and assigning your own GUID, this blog post we will walk you through the process.


# Python method to create Revit Shared Parameters from a dictionary

def CreateSharedParameterDefinitionText(k, v):
    app.SharedParametersFilename = mySharedParamDefFile
    sharedParametersFileName = app.OpenSharedParameterFile().Filename
    parameterGroup = app.OpenSharedParameterFile().Groups.get_Item("SAI_Identity")
    if parameterGroup is None:
        parameterGroup = app.OpenSharedParameterFile().Groups.Create("SAI_Identity")
    #newParameterOptions = ExternalDefinitionCreationOptions(k, ParameterType.Text) # Revit 2023
    newParameterOptions = ExternalDefinitionCreationOptions(k, SpecTypeId.String.Text) # Revit 2024
    newParameterOptions.UserModifiable = True
    newParameterOptions.Visible = True
    newParameterOptions.GUID = Guid(v)
    createNewParameter = parameterGroup.Definitions.Create(newParameterOptions)

    return createNewParameter