Table of Contents

    Book an Appointment

    How Did We Encounter the Circular Stair Challenge in 3D Plant Design?

    While working on a massive offshore oil and gas platform modeling phase for a global Engineering, Procurement and Construction (EPC) client, our engineering team was tasked with automating structural detailing. The platform required hundreds of curved and spiral stairs wrapping around massive cylindrical storage tanks and tight access shafts. In the initial phases, the design team manually placed these complex components, which was highly inefficient and prone to alignment errors.

    Our automation team stepped in to streamline this process. It is relatively straightforward to create a straight structural stair in a 3D design system using standard API calls, typically passing a system, part, top plane, bottom plane and reference vector. However, we quickly realized a gap in the standard workflows when designers asked: how can I place a circular (curved/round) stair in Smart 3D (S3D) using a custom command in C# & .NET?

    Finding a programmatic way to handle complex curved structural elements is a common hurdle in industrial modeling. This challenge inspired this article so other engineering teams and technical architects can avoid the pitfalls of native API limitations and adopt the right architectural approach for custom parametric 3D elements.

    Why is Automating Circular Stairs Crucial for Industrial Plant Modeling?

    In heavy industrial and EPC projects, structural elements like stairs, ladders and handrails represent a massive volume of the total 3D objects in a facility model. The standard .NET API handles straight stairs beautifully. By instantiating a basic Stair object in C# with a top and bottom boundary, the core engine automatically calculates the run, tread count and stringer lengths based on catalog rules.

    The problem surfaces when the architectural or safety requirements demand a circular or spiral configuration. A circular stair requires an entirely different set of mathematical parameters: a central axis (origin vector), a specified sweep angle, an inner radius, an outer radius and a calculated pitch. When the project scale dictates placing hundreds of these elements to exact safety specifications, manual placement is no longer viable. Teams must automate the placement using a programmatic custom command.

    What Were the Limitations of the Default .NET API for Stairs?

    When investigating the issue, our first instinct was to inspect the standard Stair class provided by the .NET wrapper. We noticed that if we attempted to pass non-linear reference planes or curved support structures into the standard constructor, the system would either throw an exception or default to drawing a straight staircase intersecting the nearest geometric tangents.

    We reviewed the transaction logs and COM-interop trace messages and realized the out-of-the-box structural assembly engine strictly evaluates the bounding box and linear projection of the standard stair symbol. There are no exposed default properties like Radius or SweepAngle on the base stair assembly class. Attempting to force a curved routing via standard API methods resulted in database inconsistencies where the graphical representation failed to generate, leaving phantom objects in the workspace.

    What Technical Approaches Did We Consider for Curved Stairs?

    To accurately place a circular (curved/round) stair in Smart 3D (S3D) using a custom command in C# & .NET, we had to rethink the object lifecycle. We evaluated several architectural approaches to solve this geometry constraint.

    Can We Manipulate Standard Stair Properties via Late Binding?

    We initially tried to use late binding to inject custom properties into the standard stair object after placement. We hoped the engine would recognize curved reference planes and adapt. This failed because the underlying catalog symbol for the standard stair consists of linear 3D primitives. No amount of property manipulation could force a linear symbol to sweep along a curve.

    Should We Script Individual Treads and Curved Stringers?

    Our second approach involved abandoning the stair class altogether. We considered writing a C# custom command that would mathematically calculate the spiral path, plot curved structural members for the stringers and place individual steel plates for every single tread. While technically possible, this approach was rejected. It generated hundreds of independent objects per staircase, bloating the model database and making future modifications nearly impossible for the designers.

    How Does a Custom SmartPart Symbol and C# Custom Command Solve This?

    The most robust, enterprise-grade solution was a hybrid approach. Instead of fighting the standard stair class, we decided to define a new custom parametric symbol (a SmartPart) in the catalog that understood circular geometry. We then built a C# custom command utilizing the .NET API to handle the user interactions—capturing the center point, elevation and radius clicks—and programmatically placing that custom symbol into the model. This is the exact type of architectural problem solving you expect when you hire software developer experts for proprietary CAD systems.

    How Do You Place a Circular Stair Using a Custom Command in C#?

    The final implementation involved two distinct phases. First, our database administrators added a parametric spiral stair symbol to the catalog, exposing properties like Radius, Height and SweepAngle. Second, we developed the C# Custom Command to place it.

    Here is a sanitized, generic version of the C# logic used to retrieve the custom catalog part and instantiate it in the 3D space based on user-selected inputs:

    // Ensure within a valid transaction block
    using (Transaction transaction = new Transaction(modelDB, "PlaceCircularStair"))
    {
        try
        {
            transaction.Start();
            // 1. Fetch the custom circular stair part from the Catalog
            CatalogStructHelper catalogHelper = new CatalogStructHelper();
            Part spiralStairPart = catalogHelper.GetPartByPartNumber("Custom_SpiralStair_01");
            if (spiralStairPart == null)
            {
                throw new Exception("Circular stair symbol not found in catalog.");
            }
            // 2. Define the placement geometry based on user clicks
            Position centerPoint = new Position(10.0, 5.0, 0.0); // Derived from custom command step
            Vector zAxis = new Vector(0, 0, 1); 
            Vector xAxis = new Vector(1, 0, 0);
            Matrix4X4 placementMatrix = new Matrix4X4(centerPoint, xAxis, zAxis);
            // 3. Create the Custom Assembly/Equipment instance
            // Using generic BusinessObject creation for custom parametric parts
            BusinessObject customStairOccurrence = customObjectFactory.CreateOccurrence(spiralStairPart, placementMatrix);
            // 4. Set the custom parameters for the curved geometry
            customStairOccurrence.SetPropertyValue("Radius", 2.5);
            customStairOccurrence.SetPropertyValue("TotalHeight", 5.0);
            customStairOccurrence.SetPropertyValue("SweepAngle", 270.0);
            // 5. Establish relationships to the parent system
            SystemHierarchyHelper.RelateToParentSystem(parentSystem, customStairOccurrence);
            transaction.Commit();
        }
        catch (Exception ex)
        {
            transaction.Rollback();
            // Log failure details
        }
    }
    

    Validation and Performance Considerations:

    To ensure performance, we cached the catalog queries so the command wouldn’t query the database continuously during repetitive placements. We also implemented robust collision checking within the custom command event steps to ensure the spiral stair did not clash with adjacent piping or tank walls before committing the transaction.

    What Can Architects Learn from Modifying 3D Design Software APIs?

    Tackling closed-ecosystem API limitations requires a structured mindset. Here are actionable insights engineering teams should apply when extending enterprise 3D platforms:

    • Respect the Native Logic: If an API class (like the standard straight stair) aggressively resists modification, do not force it. Build parallel custom structures (like custom SmartParts) rather than hacking the core system.
    • Separate Geometry from Business Logic: Keep complex 3D math inside the parametric symbol. Use the C# .NET API strictly for placement, data binding and relationship management.
    • Manage Transactions Carefully: When chaining multiple API calls to build complex assemblies, always wrap the logic in strict transaction blocks to prevent orphaned database objects upon failure.
    • Optimize Catalog Lookups: Database calls in COM/.NET wrapper environments are expensive. Cache your catalog item pointers during command initialization.
    • Invest in Specialized Engineering Talent: Extending heavy industrial software requires niche skills. If you are building a dedicated automation team, it pays to hire .NET developers for enterprise modernization who understand 3D vectors and matrix transformations.
    • Enhance User Experience: A custom command is only as good as its UI. Implement step-by-step state machines in your C# command to guide the designer through selecting the center point, top plane and bottom plane.

    How Did This Custom C# Automation Impact the Project?

    By shifting from forcing the native API to adopting a custom parametric symbol paired with a well-designed C# custom command, we successfully automated the placement of circular stairs across the entire facility. This eliminated the database bloat associated with manually modeled treads, ensured 100% compliance with safety clearance rules via programmatic validation and saved hundreds of engineering hours.

    If your organization is struggling with complex software integrations, API limitations or extending proprietary enterprise architectures, we can help. To explore how you can scale your automation capabilities and hire developers with the right technical pedigree, contact us.

    Social Hashtags

    #Smart3D #Smart3DAPI #CSharp #DotNET #3DModeling #CADAutomation #EngineeringAutomation #PlantDesign #EPC #SmartPlant3D

     

    Frequently Asked Questions

    Success Stories That Inspire

    See how our team takes complex business challenges and turns them into powerful, scalable digital solutions. From custom software and web applications to automation, integrations, and cloud-ready systems, each project reflects our commitment to innovation, performance, and long-term value.