Example of Custom Application

Предыдущая страницаВ началоСледующая страница

The example of custom application is supplied with T-FLEX CAD. The application is called StarsPlugin. It can be used for drawing stars.

Source files of the application are located in the T-FLEX CAD installation folder (default path on Windows: C:\Program Files\T‑FLEX Parametric CAD 17\API\StarsPlugin). *.cs files contain source code of the application, its commands and objects written in C# language using T-FLEX CAD Open API.

In order to use the standard version of the application, you don't need to compile its source code, as it is already done. The resulting StarsPlugin.dll library file is located in the ...T‑FLEX Parametric CAD 17\Program folder. The information required for adding the application into T-FLEX CAD is already included into the Applications.ini file located in the same folder and the application is already added.

You can create a custom version of the application by editing its source code, if necessary. In such case, upon editing the code, you should build the StarsPlugin.sln solution using Microsoft Visual Studio.

It is recommended to install the .NET desktop development workload for Microsoft Visual Studio, when working with source code of custom applications.

Information on the T-FLEX CAD programming interface is available in the T-FLEX CAD Open API help system, which can be invoked from the Help section of the textual menu or from the help menu.

In result, the StarsPlugin.dll library file will be created. Its location within the StarsPlugin folder depends on the selected project configuration (default location is ...StarsPlugin\bin\Debug). Replace the existing ...T‑FLEX Parametric CAD 17\Program\StarsPlugin.dll file with the new one.

Editing the content of the Program folder requires administrator rights

The ...T‑FLEX Parametric CAD 17\API\StarsPlugin folder also contains the *.tfa-file, which allows adding into T-FLEX CAD applications not mentioned in the Applications.ini file and located in arbitrary folders (see Adding Custom Applications).

 

In order to use the application, call the Applications command, select the T‑FLEX CAD Application Sample (StarsPlugin.dll) application and press the Start button.

28_AppsExampleLaunch

Upon starting the app, two new commands will appear in the Applications tab of the ribbon: Stars creation and Show window. You can add these commands into other tabs of the ribbon or toolbars, if necessary.

28_AppsExampleRibbon

Topics in this section:

Stars Creation

Stars window