Controls in Shapes doesnt work

Hy,

my problem is the controls proprty of the shape called “Frame Corner”. The manipulation from that control propertys doesnt seem to be effective in Visio.
If i try this:

            Shape test1 = diagram.Pages[pageIndex].Shapes.GetShape(diagram.AddShape(pinX, pinY, xLenght, yLenght, typname, 0));

            foreach (Aspose.Diagram.Control item in test1.Controls)
            {
                item.X.Ufe.F = "=BOUND(Width*0.1063,0,FALSE,0,MIN(Width*0.5,Height*0.5))";
                item.Y.Ufe.F = "=Height*1";
                item.XDyn.Ufe.F = "=Width*0";
                item.YDyn.Ufe.F = "=Height*0";
            }

I see in Visio developertools the right value, but it hasn’t any other result on that sahpe. Now if I change the value in devtools, the Shape will set its propertys.
I have tryed the shape called “Plaque” and some others, allways seems the be the same problem.
My experiment, to fix it with the method test1.RefreshData(), wasnt successful.
The Class is in the upload.
VisioTest.zip (102.6 KB)

@dvvde,

We managed to replicate the said problematic behavior in our environment. It has been logged under the ticket ID DIAGRAMNET-51401 in our bug tracking system. We have linked your post to this ticket and will keep you informed regarding any available updates.

@dvvde,

The linked ticket ID DIAGRAMNET-51401 has been fixed. Please download and try the latest Hotfix version 17.11.1: Aspose.Diagram for .NET 17.11.1, and then let us know how that goes into your environment.

Please omit equal sign “=” when setting formula:

[C#]

foreach (Aspose.Diagram.Control item in test1.Controls)
{
    item.X.Ufe.F = "BOUND(Width*0.1063,0,FALSE,0,MIN(Width*0.5,Height*0.5))";
    item.Y.Ufe.F = "Height*1";
    item.XDyn.Ufe.F = "Width*0";
    item.YDyn.Ufe.F = "Height*0";
}

I am sorry, but i have tried the Hotfix and to leave the equel sign. In my enviroment i have still the same problem.
But maybe you can get me an enviroment that works, so i can compaire that way.

@dvvde,

We managed to replicate the problem with the Hotfix version 17.11.1 and have reopened the ticket ID DIAGRAMNET-51401. We will let you know once a significant progress has been made in this regard.

@dvvde,

The linked ticket ID DIAGRAMNET-51401 has been fixed. Please download and try the latest version 18.1 of Aspose.Diagram for .NET API.

I am sorry to say it, but also the newest Version of Aspose doesn’t change the Control Item. The yellow dot move on that point in :

item.X.Ufe.F = “BOUND(Width0.125,0,FALSE,0,Width0.5)”;

Or on:

item.Y.Ufe.F = “Height*1”;

The remarkable thing is, the coordinates in the ShapeSheet are shown correct, but the controldot is not on the right position. After the value in ShapeSheet are changed, or just confirm the value with enter, the dot change his position on the right spot.
Maybe its the same problem that you have allready solved in this thread Scale page to fit diagram - #10 by imran.rafique

I have tried this:

String pattern = @“c:\vorlagea4.vsdx”;
String SaveFolder = “c:\testordner\”;
double onePT = 0.013889;
double xLenght = 0.2;
double yLenght = 0.2;
double pinX = 1.968503937;
double pinY = 1.968503937;
int pageIndex = 0;
String typname = “Rahmenecke”;
DiagramSaveOptions options = new DiagramSaveOptions(SaveFileFormat.VSDX);

        Diagram diagram = new Diagram(pattern);
        Aspose.Diagram.Page page = diagram.Pages.GetPage(0);           

        Shape test1 = diagram.Pages[pageIndex].Shapes.GetShape(diagram.AddShape(pinX, pinY, xLenght, yLenght, typname, 0));

        foreach (Aspose.Diagram.Control ctr in test1.Controls)
        {
            ctr.X.Ufe.F = "BOUND(Width*0.125,0,FALSE,0,Width*0.5)";
            ctr.Y.Ufe.F = "Height*1";
        }

        diagram.Save(SaveFolder + "diagramm.vsdx", options);
        System.Diagnostics.Process.Start(SaveFolder + "diagramm.vsdx");

I have tried Shapes from other Sides, just Like Cisco, seems the same Problem.

If you change:
String typname = “Rahmenecke”;
into
String typname = “3560E-12D”; (Thats a Cisco Shape from this side: Products - Visio Stencils - Cisco)
The Shape shows the same behave with its Image.

Use this pattern: vorlagea4.zip (225.9 KB)

Thank you

@dvvde,

We managed to replicate the said problem in our environment with master Rahmenecke. It has been logged under the ticket ID DIAGRAMNET-51426 in our bug tracking system. We have linked your post to this ticket and will keep you informed regarding any available updates.

Please highlight the problematic and expected position of the dot (master: 3560E-12D) with the help of a snapshot.

aspose forum.zip (128.3 KB)

This are the comment pictures in the upload. the code is below and for your tests please use the uploaded Diagram.

The code for the cisco shape is:

        String pattern= @"D:\Shares\Anwendungen\DiagramScalierer\Diagrammvorlage\cisco.vsdx";         
        double xLenght = 2;
        double yLenght = 2;
        double pinX = 1.968503937;
        double pinY = 1.968503937;
        String typname = "3560E-12D";
        DiagramSaveOptions options = new DiagramSaveOptions(SaveFileFormat.VSDX);
        Diagram diagram = new Diagram(pattern);

        Shape test1 = diagram.Pages[pageIndex].Shapes.GetShape(diagram.AddShape(pinX, pinY, xLenght, yLenght, typname, 0));
        test1.XForm1D.EndX.Value =2* (0.393701);
        test1.XForm1D.EndY.Value = 0.19685;
        test1.XForm1D.BeginY.Value = 0.19685;
        test1.XForm1D.BeginX.Value = 0.19685;

        test1.XForm.Width.Ufe.F = "SQRT((EndX-BeginX)^2+(EndY-BeginY)^2)";
        test1.XForm.Height.Ufe.F = "GUARD(Width*0.0921)";

The code for the rahmenecke is:

        String pattern= @"D:\Shares\Anwendungen\DiagramScalierer\Diagrammvorlage\vorlagea4.vsdx";
        double xLenght = 0.2;
        double yLenght = 0.2;
        double pinX = 3*(1.968503937);
        double pinY = 1.968503937;
        String typname = "Rahmenecke";
        DiagramSaveOptions options = new DiagramSaveOptions(SaveFileFormat.VSDX);
        Diagram diagram = new Diagram(pattern);
        Aspose.Diagram.Page page = diagram.Pages.GetPage(0);           

        Shape test1 = diagram.Pages[pageIndex].Shapes.GetShape(diagram.AddShape(pinX, pinY, xLenght, yLenght, typname, 0));
        
        foreach (Aspose.Diagram.Control ctr in test1.Controls)
        {
            ctr.X.Ufe.F = "BOUND(Width*0.125,0,FALSE,0,Width*0.5)";
            ctr.Y.Ufe.F = "Height*1";

        }

I hope it can help you.

@dvvde,

Please call RefreshData method of the Shape instance before saving in the output VSDX drawing. The linked ticket ID DIAGRAMNET-51426 has been closed.
C#

test1.RefreshData();
diagram.Save(dataDir + "diagramm.vsdx", options);

Kindly send us your source cisco.vsdx drawing. We will investigate and share our findings with you.

Thx, that refesh method works fine.

diagramm.zip (404.3 KB)
In the “Diagram” Zipfile you will find the vsdx

3560.zip (2.9 MB)
In the 3650 Zipfile is the original items from the official Cisco side.

@dvvde,

We managed to replicate the said problem in our environment. It has been logged under the ticket ID DIAGRAMNET-51427 in our bug tracking system. We have linked your post to this ticket and will keep you informed regarding any available updates.

@dvvde,

The linked ticket ID DIAGRAMNET-51427 has been fixed. Please download and try the latest Hotfix version 18.2.1: Aspose.Diagram for .NET 18.2.1, and then let us know how that goes into your environment.

Thx it works for now.

The issues you have found earlier (filed as DIAGRAMNET-51427) have been fixed in Aspose.Diagram for .NET 18.3 API. This message was posted using BugNotificationTool from Downloads module by imran.rafique