Nevron .NET Vision
Diagram for .NET / User's Guide / Extensions / Visio Import
In This Topic
    Visio Import
    In This Topic
     Overview

    The Visio Importer makes it possible to use Visio shapes in your Nevron diagrams. It takes as an input a XML serialized Visio stencil (VSX) and imports its shapes in a Nevron library document which you can use with any Nevron diagram.

    To import a Visio stencil in a Nevron library document you should do the following actions: 

    • Add a reference to the Nevron.Diagram.dll assembly to your project
    • Add the Nevron.Diagram.Visio namespace to the using (Import for VB) clauses of your code file
    • Create an instance of the NVisioImporter class passing a Nevron library document to its constructor
    • Call the Import method of the Visio importer to initiate the importing process

    Here's a sample source code:

    C#
    Copy Code
    NLibraryDocument libraryDocument = new NLibraryDocument();
    NVisioImporter visioImporter = new NVisioImporter(libraryDocument);
    visioImporter.Import("D:\\VisioStencil.vsx");
    
    Visual Basic
    Copy Code
    Dim libraryDocument As NLibraryDocument = New NLibraryDocument()
    Dim visioImporter As NVisioImporter = New NVisioImporter(libraryDocument)
    visioImporter.Import("D:\\VisioStencil.vsx")
    

    You can control the way the Visio importer imports Visio shapes using its properties: 

    • MeasurementUnit - determines the measurement unit the importer should use. By default set to inch (NGraphicsUnit.Inch), because inch is the default measurement unit used in Visio. 
    • PreserveShapeHierarchy - Controls whether the importer should preserve the shape hierarchy as in the Visio stencil thus creating nested groups or to import all Visio child shapes as custom paths in a composite shape. By default set to false. If you set this property to true the Visio child shapes will be imported as shapes in a group (or groups nested in a group) thus giving you a great level of control over each child shape and making it possible to use inherited styles. But note that this will also lead to higher memory consumption than the import of the Visio child shapes as custom paths in a composite shape.
     Limitations
    1. Visio has 4 types of shapes:
      • Shape: object with geometry, text, line and fill style, etc.
      • Group: same as shape, but can also include a collection of member shapes and thus can represent hierarchical concepts.
      • Guide: a variant of shape which represents the Guide drawing object.
      • Foreign: defines the shape as representing some variety of non-Visio object (metafile, bitmap, PNG, JPEG, etc.).

        The importer supports the first two types of shapes: shape and group.
    2. Importing of the text of the shapes is currently not supported
    3. Importing of shape connection points (a.k.a. ports) is not supported