By Daniel Du
Similar with Map 3D industry model, Autodesk Infrastructure Map Server includes industry model as well if you installed Infrastructure Application Extension. It provides APIs for customization as well, and more than 100 sample projects are released with the project, they can be found in C:Program FilesAutodeskAutodesk Infrastructure Web Server Extension 2013wwwAppExtDevelopmentSamples by default.
To run these samples, open CSSamples.sln in Visual Studio, this solution contains all sample projects in the folder, you can want to open specific one instead of opening them all.
Please not that some samples do not work for AIMS Application Extension(a.k.a Topobase Web or TBWeb), for example CSSample01. Let’s take a look at the tbp file. BTW, the tbp file is AutoCAD Map 3D/AIMS plugin definition file (identified by the .tbp extension), it should be copied to AppExtBin folder so that Map3D/AIMS knows about your plugin.
Let’s examine the tbp file:
<?xml version="1.0" encoding="utf-8"?><PlugIn> <Default AssemblyName="CSSample01.dll" Namespace="CSSample01" DocumentKey="" MapName="" Priority="100" ExecutionTargetWeb="False" ExecutionTargetDesktop="True" Company="Autodesk, Inc." Author="Map Engineering" /> <ApplicationPlugIn ClassName="MyApplication"/> </PlugIn>
ExecutionTargetWeb = False, that means it is not supposed to be running in AIMS, it only works in Map 3D desktop. If you open Form1.cs, you will notice that it is just a Windows Form, so that explains why it does not work for TBWeb.
public class Form1 : System.Windows.Forms.Form
So here is the question, which samples are supposed to run in AIMS(TBWeb)? Well, actually development team did quite a lot of work to unify the form in both Map 3D desktop and AIMS web environment. If you want your form runs on both Map 3D desktop and AIMS, you will derive your form from Autodesk.Map.IM.Forms.ApplicationForm. Let’s take a look at CSSample100.
namespace CSSample100{ public class Form1 : Autodesk.Map.IM.Forms.ApplicationForm {
…
And take a look at the tbp file of CSSample100:
<?xml version="1.0" encoding="utf-8"?><PlugIn> <Default AssemblyName="CSSample100.dll" Namespace="CSSample100" DocumentKey="" MapName="" Priority="100" ExecutionTargetWeb="True" ExecutionTargetDesktop="True" Company="Autodesk, Inc." Author="Map Engineering" /> <ApplicationPlugIn ClassName="MyApplication"/> </PlugIn>
This sample application works for Map 3D desktop and AIMS Web application as well.
To run this sample on AIMS, please make sure that your output folder is set to C:Program FilesAutodeskAutodesk Infrastructure Web Server Extension 2013wwwAppExtBin:
And set “Copy to Output Directry” tp “Copy always” or “Copy if newer”. Once the project is built successfully and the necessary files (dll and tbp) are copied to AppExtBin folder, you can launch a browser to open your industry model (http://localhost/mapserver2013/appext/login.aspx ), I am using SQL Server here, it should be similar for Oracle.
Open the project:
A new button will appear in “Autodesk Industry Model Explorer”, and a web form will show up when clicking this button.
Please turn off pop-up blocker of your browser.
There are quit a lot other samples in C:Program FilesAutodeskAutodesk Infrastructure Web Server Extension 2013wwwAppExtDevelopmentSamples, and the Map 3D document on Wikihlep should be helpful to understand and run these sample.






Leave a Reply