Visio Integration with AX

Integration of Microsoft Visio is highly evident in Reverse Engineering in Dynamics AX 4.0. Here is a small example to show how it can actually work
 

static void openVisio(Args _args)

{

    COM                     visioApplication;

    COM                     visioDocuments;

    COM                     visioDocument;

    COM                     page;

    ;

 

    visioApplication = new COM( ‘visio.application’ );

    visioApplication.screenUpdating( 0 );

 

    visioDocuments = visioApplication.documents();

    visioDocument = visioDocuments.add(‘Basic Flowchart.vst’);

    page = visioApplication.ActivePage();

   

    page.DrawRectangle(1, 1, 3, 1.5);

    page.DrawLine(2, 1.5, 2, 2);

    page.DrawRectangle(1, 2, 3, 2.5);

      }
 
The above example opens a visio file and draws following figure
 
These objects will be drawn using Basic Flow chart template. You can use different template as required for example if you want to draw a UML flow then use "UML Model Diagram.vst"
 
Hope this helps you in jump starting in Visio integration.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s