Sample - Designer Express: Integrate Cost Item Data

Version 4

    Versions: 10.0.1 - current

    Product Availability: ArcFM Desktop (Designer Express)

     

    This developer sample opens a design programmatically, retrieves the cost item data for that design and displays it in HTML format. This sample demonstrates how you can retrieve cost item data for integration with another application.

    The code sample has a DesignID hard coded; you will need to modify this portion of the code. Note in the example below that the code sample retrieves cost item data for a design with the ID 223. DesignIDs are stored in the MM_EXPRESS_DESIGNS table.

     

    public override void OnClick()

      {

      System.Windows.Forms.Cursor oldCursor = System.Windows.Forms.Cursor.Current;

      System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;

       try

      {

      IMMLoginUtils loginUtils = new MMLoginUtilsClass();

      IWorkspace workspace = loginUtils.LoginWorkspace;

      ExpressDesign expressDesign = ExpressDesign.GetInstance();

      expressDesign.OpenReadOnly(workspace, 223); //ID for specific design; you will need to modify this.
      CostEstimate costEstimate = expressDesign.CostEstimate;

      ShowXmlReportXml(costEstimate, null);

      }

       finally

      {

      System.Windows.Forms.Cursor.Current = oldCursor;

      }

      }

     

     

    How to Use:

    1. You will need to add the button to a toolbar. It is in the Developer Samples command category and named Test Open Design.
    2. You must also have an express design open before this tool will work.
    3. Click the Test Open Design button to show the cost item data in HTML format for the DesignID hardcoded in the project.

           

    This report uses the Estimate.xsl report created when you run a Design Estimate report. If you have never run a Design Estimate report before, this stylesheet may not exist and the deveoper sample will fail to open the report. Open an Express design and click the Export button in the Design Estimate tool. This will create the necessary stylesheet.

           

    You may also need to set XML files to be opened in Internet Explorer by default. It will not work with Firefox.

     

    Requires:

    All of the files shown below are required for the solution to build successfully.

     

    FileDescription
    IntegrateCostItemData.csprojC# project containing the code to integrate cost item data with Designer Express.
    OpenDesign.csThis class module provides methods used by the Remove Sketch tool.