# goncalogbastos/civil3d-addin architecture

> Architecture diagram of the GitHub repository goncalogbastos/civil3d-addin, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/goncalogbastos/civil3d-addin
- Repository: https://github.com/goncalogbastos/civil3d-addin

## Overview

##### Project type and purpose
- This is a Visual Studio solution (“Plugins_Collection.sln”) containing two C# class-library projects: AutoCAD_Plugins and Civil3D_Plugins.
- Each project compiles to one or more .dll files that implement custom commands (00_…, 01_…, … .cs) against the AutoCAD and Civil 3D .NET APIs.
- At runtime you load those DLLs (and the accompanying LISP loader: NETLOAD_Plugins_Import.lsp) into the host applications to automate drafting/infrastructure‐design tasks.

##### File structure
- Top level
- Plugins_Collection.sln – the VS solution
- NETLOAD_Plugins_Import.lsp – AutoCAD LISP script to load the DLLs
- References/ – (probably third‐party or API .dll references)
- README.md – high‐level description
- AutoCAD_Plugins/
- .csproj – builds a class library for AutoCAD
- 00_AutoCAD_Plugins.cs through 18_… .cs – individual command implementations
- Properties/AssemblyInfo.cs – assembly metadata
- Civil3D_Plugins/
- .csproj – builds a class library for Civil 3D
- 00_Civil3D_Plugins.cs through 11_SampleLines.cs – individual Civil 3D command implementations
- Surfaces.cs – shared helper code
- Properties/AssemblyInfo.cs

##### Key insights from README
- The repo’s goal is to share “AutoCAD and Civil 3D commands” used in professional infrastructure projects.
- You must allow the host apps to read the generated .dll files (i.e., set the proper trusted locations or security flags in AutoCAD/Civil 3D).

## Diagram (Mermaid)

```mermaid
flowchart TD
    DEV["Development Environment (Visual Studio + MSBuild)"]:::build
    click DEV "https://github.com/goncalogbastos/civil3d-addin/blob/master/Plugins_Collection.sln"

    subgraph "AutoCAD Plugins Project"
        ACSP["AutoCAD_Plugins.csproj"]:::build
        click ACSP "https://github.com/goncalogbastos/civil3d-addin/blob/master/AutoCAD_Plugins/AutoCAD_Plugins.csproj"
        ACMeta["AssemblyInfo.cs"]:::meta
        click ACMeta "https://github.com/goncalogbastos/civil3d-addin/blob/master/AutoCAD_Plugins/Properties/AssemblyInfo.cs"
        subgraph "Commands"
            A00["00_AutoCAD_Plugins.cs"]:::code
            click A00 "https://github.com/goncalogbastos/civil3d-addin/blob/master/AutoCAD_Plugins/00_AutoCAD_Plugins.cs"
            A01["01_AuxiliarLayer.cs"]:::code
            click A01 "https://github.com/goncalogbastos/civil3d-addin/blob/master/AutoCAD_Plugins/01_AuxiliarLayer.cs"
            A18["18_PickMPZPoint.cs"]:::code
            click A18 "https://github.com/goncalogbastos/civil3d-addin/blob/master/AutoCAD_Plugins/18_PickMPZPoint.cs"
        end
        ACOut["AutoCAD_Plugins.dll"]:::runtime
    end

    subgraph "Civil3D Plugins Project"
        C3SP["Civil3D_Plugins.csproj"]:::build
        click C3SP "https://github.com/goncalogbastos/civil3d-addin/blob/master/Civil3D_Plugins/Civil3D_Plugins.csproj"
        C3Meta["AssemblyInfo.cs"]:::meta
        click C3Meta "https://github.com/goncalogbastos/civil3d-addin/blob/master/Civil3D_Plugins/Properties/AssemblyInfo.cs"
        C3Helper["Surfaces.cs"]:::code
        click C3Helper "https://github.com/goncalogbastos/civil3d-addin/blob/master/Civil3D_Plugins/Surfaces.cs"
        subgraph "Commands"
            C00["00_Civil3D_Plugins.cs"]:::code
            click C00 "https://github.com/goncalogbastos/civil3d-addin/blob/master/Civil3D_Plugins/00_Civil3D_Plugins.cs"
            C01["01_AlignmentFromPolyline.cs"]:::code
            click C01 "https://github.com/goncalogbastos/civil3d-addin/blob/master/Civil3D_Plugins/01_AlignmentFromPolyline.cs"
            C11["11_SampleLines.cs"]:::code
            click C11 "https://github.com/goncalogbastos/civil3d-addin/blob/master/Civil3D_Plugins/11_SampleLines.cs"
        end
        C3Out["Civil3D_Plugins.dll"]:::runtime
    end

    APIRefs["Autodesk .NET API References"]:::api
    click APIRefs "https://github.com/goncalogbastos/civil3d-addin/tree/master/References/"
    LISP["NETLOAD_Plugins_Import.lsp"]:::runtime
    click LISP "https://github.com/goncalogbastos/civil3d-addin/blob/master/NETLOAD_Plugins_Import.lsp"
    Doc["README.md"]:::doc
    click Doc "https://github.com/goncalogbastos/civil3d-addin/blob/master/README.md"

    DEV -->|"compile"| ACSP
    DEV -->|"compile"| C3SP
    ACSP -->|"produces"| ACOut
    C3SP -->|"produces"| C3Out

    ACOut -->|"NETLOAD"| LISP
    C3Out -->|"NETLOAD"| LISP

    LISP -->|"loads into"| AC_Host["AutoCAD Host"]:::host
    LISP -->|"loads into"| C3_Host["Civil 3D Host"]:::host

    AC_Host -->|"invoke command"| AC_UI["User invokes command"]:::host
    C3_Host -->|"invoke command"| C3_UI["User invokes command"]:::host

    AC_UI -->|"calls command class"| ACOut
    C3_UI -->|"calls command class"| C3Out

    ACOut -->|"uses API"| APIRefs
    C3Out -->|"uses API"| APIRefs

    Doc -.-> DEV

    classDef build fill:#CCE5FF,stroke:#005B9F
    classDef runtime fill:#DFF2BF,stroke:#4F8A10
    classDef host fill:#FFD2D2,stroke:#D8000C
    classDef api fill:#E1E8F0,stroke:#3A5785
    classDef code fill:#F5F5F5,stroke:#999
    classDef meta fill:#FFF0F0,stroke:#D45
    classDef doc fill:#FFF8DC,stroke:#B8860B
```
