We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

how to import visio stencils to Symbol palettes

Hello,

I am evaluating the Essential diagrams and its very nice. I want to import the MS Visio stencils into Symbol palettes.

One of my customer wants to use his own visio stencils in the Essential diagrams.All the visio stencils are in .vsd files.

Please advise me.


Thanks and Regards,
Kesavan



13 Replies

SR Sri Rajan Syncfusion Team February 6, 2008 06:57 PM UTC

Hi Kesavan,

Thank you for your interest in Syncfusion products.

How to import the MS Visio stencils into Symbol palette?
----------------------------------------------------------------------

To import the MS Visio stencils into Symbol palette, you need to convert the Viso files(.vsd or .vss) using VisioStensilConvertor and then add it to the palette using paletteGroupBar.AddPalette. Please refer the code below.

VisioStencilConverter converter = new VisioStencilConverter(strFileName, this);
converter.ShowProgressDialog = true;
curSymbolPalette = converter.Convert();
if (curSymbolPalette != null)
this.paletteGroupBar.AddPalette(curSymbolPalette);


Please refer to the attached sample for more details.

Sample

Please refer to the Online Documentation, that is available in the below path, that explain in detail.

Online Documentation

In this following path, Stencil Import Documentation is available in the below mentioned subtitle,
Common --> Concepts and Features --> Loading and Saving files --> Visio Stencil Import

Note:
*In this sample Symbol file(.vsd) is available in the current application path.
* In this sample to load *.vsd files into the Symbol Palette, you need to select the below options,
File --> Add Symbol Palette

Please let me know if this helps.

Regards,
Srirajan




CH cheon replied to Sri Rajan February 7, 2018 08:25 AM UTC

Hi Kesavan,

Thank you for your interest in Syncfusion products.

How to import the MS Visio stencils into Symbol palette?
----------------------------------------------------------------------

To import the MS Visio stencils into Symbol palette, you need to convert the Viso files(.vsd or .vss) using VisioStensilConvertor and then add it to the palette using paletteGroupBar.AddPalette. Please refer the code below.

VisioStencilConverter converter = new VisioStencilConverter(strFileName, this);
converter.ShowProgressDialog = true;
curSymbolPalette = converter.Convert();
if (curSymbolPalette != null)
this.paletteGroupBar.AddPalette(curSymbolPalette);


Please refer to the attached sample for more details.

Sample

Please refer to the Online Documentation, that is available in the below path, that explain in detail.

Online Documentation

In this following path, Stencil Import Documentation is available in the below mentioned subtitle,
Common --> Concepts and Features --> Loading and Saving files --> Visio Stencil Import

Note:
*In this sample Symbol file(.vsd) is available in the current application path.
* In this sample to load *.vsd files into the Symbol Palette, you need to select the below options,
File --> Add Symbol Palette

Please let me know if this helps.

Regards,
Srirajan



Hi,Sri,
I refered your code to import visio file into Symbol Palette,but the program into interrupt mode while code execution to "curSymbolPalette = converter.Convert();" .How to solve this problem,please advise me.Thank you!


NG Naganathan Ganesh Babu Syncfusion Team February 8, 2018 12:25 PM UTC

Hi Kesavan, 
 
Please note that Syncfusion diagram support conversion of Visio stencil to diagram symbol EDP file only with Visio version 2010 or below. But we suspect that, you are trying to load Visio 2013 stencil file to palette.  
 
We also suggest you to install Visio 2010 version in your system to successful encode and decode the Visio 2010 stencil to diagram’s palette. We have already created a feature request “Need to import Visio 2013 stencil files” and it is added to our feature request list and it will be available in any of our upcoming releases.   
 
Regards, 
 
Naganathan K G 



CH cheon replied to Naganathan Ganesh Babu March 19, 2018 09:05 AM UTC

Hi Kesavan, 
 
Please note that Syncfusion diagram support conversion of Visio stencil to diagram symbol EDP file only with Visio version 2010 or below. But we suspect that, you are trying to load Visio 2013 stencil file to palette.  
 
We also suggest you to install Visio 2010 version in your system to successful encode and decode the Visio 2010 stencil to diagram’s palette. We have already created a feature request “Need to import Visio 2013 stencil files” and it is added to our feature request list and it will be available in any of our upcoming releases.   
 
Regards, 
 
Naganathan K G 


Hi,Naganathan.Thank you very much!
I use Visio 2010 to import Visio file was successful!
But there has a blue fork in Visio palette graphics.Could you please help me to solve this problem.

Please refer to the attach file for more details.

Attachment: DiagramPic1_ffcd3f75.rar


NG Naganathan Ganesh Babu Syncfusion Team March 20, 2018 09:12 AM UTC

Hi Kesavan, 
 
The Visio’s shapes contain connection points by default and we do not set visibility as false for connection point for that shapes while converting the Visio shapes to the Diagram’s shapes. So only the Visio’s converted shapes are showing the connection point in our Diagram.  
 
We have confirmed that the issue with the connection point visibility updated wrongly while converting Visio stencil to diagram is a defect and we have logged a defect report. The fix for this issue will be available in our volume 2 release it will be available on end of the April 2018. 
 
However, we suggest you to use ConnectionPoint’s “Visible” property to set as false after converting the Visio’s shapes to diagram compatibility by using SymbolPalette’s “Nodes” collection property. Please refer to the below code example. 
 
Code example: 
 
[C#] 
 
SymbolPalette paletteToReturn = null; 
            string strFileName = @"...\\...\\SOACP_Visio_Stencil.vss"; 
            //Create an instance of VisioStencilConverter 
            VisioStencilConverter converter = new VisioStencilConverter(strFileName); 
            converter.ShowProgressDialog = true; 
            //Convert the stencil as SymbolPalette 
            paletteToReturn = converter.Convert(); 
 
            ///Hide the connection point by default 
            foreach (Node node in paletteToReturn.Nodes) 
            { 
                foreach (ConnectionPoint cp in node.Ports) 
                { 
                    if (!(cp is CentralPort)) 
                    { 
                        cp.Visible = false; 
                    } 
                } 
            } 
 
            paletteGroupBar1.AddPalette(paletteToReturn);

 
Also in our diagram control, we can only set enable/disable the visibility option to hide the connection point manually. We don’t have built-in support to the connection point become visible, if we will move the connector’s endpoint to near of them like MS Visio. However, we can achieve this behavior in application level to use Diagram’s MouseMove event to enable/disable the visibility of the connection point when the Diagram.Controller’s “ActiveTool” is in “HandleMoveTool” mode. Please refer to the below code example and sample. 
 
Code example: 
 
[C#] 
 
diagram1.MouseMove += diagram1_MouseMove; 
   void diagram1_MouseMove(object sender, MouseEventArgs e) 
        { 
            if (diagram1.Controller.ActiveTool is HandleMoveTool && diagram1.Controller.ActiveTool.InAction) 
            { 
                Node tempHit = diagram1.Controller.GetNodeAtPoint(this.diagram1.Controller.MouseLocation); 
                if (tempHit != null) 
                { 
                    nodeHit = tempHit; 
                    foreach (ConnectionPoint cp in nodeHit.Ports) 
                    { 
                        if (!(cp is CentralPort)) 
                        { 
                            cp.Visible = true; 
                        } 
                    } 
                } 
                if (tempHit == null && nodeHit != null) 
                { 
                    foreach (ConnectionPoint cp in nodeHit.Ports) 
                    { 
                        if (!(cp is CentralPort)) 
                        { 
                            cp.Visible = false; 
                        } 
                    } 
                    nodeHit = null; 
                } 
            } 
             
        } 
 
Sample: 
 
 
Regards, 
 
Naganathan K G 



CH cheon April 9, 2018 08:10 AM UTC

Hi Naganathan,
I tried your way,but it not work.
And I'd like to ask how to realize visio palette's adsorption?
Regards,
Kesavan


NG Naganathan Ganesh Babu Syncfusion Team April 10, 2018 12:56 PM UTC

Hi Kesavan, 
Could you please share us more information such as elaborate your requirement in detail with video/screen shot which will help us to analyze further and provide you a better solution. 
Regards, 
Naganathan K G 



CH cheon replied to Naganathan Ganesh Babu April 11, 2018 02:18 AM UTC

Hi Kesavan, 
Could you please share us more information such as elaborate your requirement in detail with video/screen shot which will help us to analyze further and provide you a better solution. 
Regards, 
Naganathan K G 


Hi,Thank you for your patience.
I have two problems,
1.I referred to your code example,but my visio shapes still have XPort.
```
             string visioname = FindFile("basic shapes2.vss");
            if (visioname != null)
            {
                VisioStencilConverter converter = new VisioStencilConverter(visioname, this);
                converter.ShowProgressDialog = true;
                paletteToReturn = converter.Convert();
                paletteToReturn.Name = "visio file";
                foreach(Node node in paletteToReturn.Nodes)
                {
                    foreach(ConnectionPoint pt in node.Ports)
                    {
                        pt.Visible = false;
                    }
                }
                this.paletteGroupBar.AddPalette(paletteToReturn);
            }
```
2.Does there have any way to optimize visio shape's adsorption effect.(Sorry I don't know how to elaborate this problem,it's effect just not running good as well as .edp file)

Please refer to the attached caption,hope this could help you to understand.

Thanks and regards.


Attachment: adsorption_57fcdd6a.rar


NG Naganathan Ganesh Babu Syncfusion Team April 11, 2018 11:57 AM UTC

Hi Kesavan, 
 
Please confirm us whether you need to apply a shadow style (please refer to the below attached image) for a shape which is converted from the Visio stencil to Diagram shape? If yes, we will analyze further in our diagram source and provide a solution for both scenarios of visibility of port and shadow style applying issue while converting the Visio stencil to Diagram shape.  
 
 
 
Regards, 
 
Naganathan K G 



CH cheon replied to Naganathan Ganesh Babu April 12, 2018 05:46 AM UTC

Hi Kesavan, 
 
Please confirm us whether you need to apply a shadow style (please refer to the below attached image) for a shape which is converted from the Visio stencil to Diagram shape? If yes, we will analyze further in our diagram source and provide a solution for both scenarios of visibility of port and shadow style applying issue while converting the Visio stencil to Diagram shape.  
 
 
 
Regards, 
 
Naganathan K G 


Hi Naganathan.

Thank you for your reply.

I don't need shadow style.I want to know is how to build up visio shape's adsorption when I drag one shape to attach another shape.


NG Naganathan Ganesh Babu Syncfusion Team April 13, 2018 12:20 PM UTC

Hi Kesavan, 
 
Regarding visibility of port problem, 
Sorry for the inconvenience caused. 
 
After conversion of the visio stencil to diagram shape, the shapes are in group. So, we need to hide the ports in children of the group node. please refer to the below modified code example. 
 
Code example: 
 
[C#] 
 
///Hide the connection point by default 
            foreach (Node node in paletteToReturn.Nodes) 
            { 
                if (node is Group) 
                { 
                    foreach (Node child in (node as Group).Nodes) 
                    { 
                        foreach (ConnectionPoint cp in child.Ports) 
                        { 
                            if (!(cp is CentralPort)) 
                            { 
                                cp.Visible = false; 
                            } 
                        } 
                    } 
                } 
            } 
Regarding visio shape's adsorption when I drag one shape to attach another shape. 
Please confirm us whether you need to enable the guide lines while dragging the shapes and snap to grid with others shape? If yes, we suggest you to use Diagram.Controller.Guides “Enable” property to enable/disable the guide lines for the node while snapping with other nodes. Please refer to the below code example. 
 
Code example: 
 
[C#] 
 
diagram1.Controller.Guides.Enable = true;            diagram1.Controller.Guides.LineStyle.LineColor = Color.Red; 
        } 
 
Regards, 
 
Naganathan K G 



CH cheon replied to Naganathan Ganesh Babu April 16, 2018 09:21 AM UTC

Hi Kesavan, 
 
Regarding visibility of port problem, 
Sorry for the inconvenience caused. 
 
After conversion of the visio stencil to diagram shape, the shapes are in group. So, we need to hide the ports in children of the group node. please refer to the below modified code example. 
 
Code example: 
 
[C#] 
 
///Hide the connection point by default 
            foreach (Node node in paletteToReturn.Nodes) 
            { 
                if (node is Group) 
                { 
                    foreach (Node child in (node as Group).Nodes) 
                    { 
                        foreach (ConnectionPoint cp in child.Ports) 
                        { 
                            if (!(cp is CentralPort)) 
                            { 
                                cp.Visible = false; 
                            } 
                        } 
                    } 
                } 
            } 
Regarding visio shape's adsorption when I drag one shape to attach another shape. 
Please confirm us whether you need to enable the guide lines while dragging the shapes and snap to grid with others shape? If yes, we suggest you to use Diagram.Controller.Guides “Enable” property to enable/disable the guide lines for the node while snapping with other nodes. Please refer to the below code example. 
 
Code example: 
 
[C#] 
 
diagram1.Controller.Guides.Enable = true;            diagram1.Controller.Guides.LineStyle.LineColor = Color.Red; 
        } 
 
Regards, 
 
Naganathan K G 


Hi Naganathan

The port problem is solved,Thank you very much! 

And question 2 is yes,the guide line is helpful,but it's still cannot attached well while one shape's width or height not equal to another shape's.

Visio 2010 works well,maybe this problem result form underlying code?

The attachment picture might help you to understand,please help me.If it's hard to solve,just forget it.

Caused you so much trouble...

Best Regards.

Attachment: pic1_b9bfd5ad.rar


NG Naganathan Ganesh Babu Syncfusion Team April 18, 2018 08:47 AM UTC

Hi Kesavan, 
 
In diagram control, the nodes are snapped based on the Grid’s Points/Lines alone and not for snapping based on the objects. So, we have considered it as feature request with “Snapping the nodes based on the others nodes” and we will implement this feature in any of our upcoming releases.  
 
Regards, 
 
Naganathan K G 
 


Loader.
Live Chat Icon For mobile
Up arrow icon