Astah User's Guide

Source Code Generation in C# / C++

Generate C# Source code

[Export C#] is used to generate C# Skeleton Code from selected Diagram Elements. The Definitions of Classes and Operations are exported as Documentation Comments.

  1. Select [Tool]-[C#]-[Export C#] in the Main Menu to open the “Select” Dialog.
  2. Select the target folder in the “Select” Dialog.
  3. Select the target Model, from which .cs files are to be generated, in the “Select Diagram Element” Dialog.
    Specify the charset to use upon on exporting C#.
    export_csharp
  4. Click [C# Option] button to set the details.
    export_csharp_option
  5. Click [OK] to generate the source code.

Generate C++ Source Code

“Export C++” is used to generate C++ Skeleton Code from selected Diagram Elements. The Definitions of Classes and Operations are exported as Documentation Comments.

  1. Select [Tool]-[C++]-[Export C++] in the Main Menu to open the “Select” Dialog.
  2. Select the target folder in the “Select” Dialog.
  3. Select the target Model in the “Select Diagram Element” Dialog.
    export_cpp
  4. Click [C# Option] button to set the details.
    export_cpp_option
  5. Click [OK] to generate the source code.
C++ Option
LabelDescription
Export #ifndef, #define, #endif in header file.Export #ifndef, #define and #endif to a header file.
Include listExport a list divided by , (comma) to a header file and a resource file
i.e.)When expporting string、vector:
#include <string>
#include <vector>
Header file extensionSpecify the header file extension (h, hxx)
Source file extensionSpecify the source file extension (cpp, cxx)