We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

1-D Endpoints do not Reflect Changes Made in Diagram.NET

I have an issue with a drawing that I am working on. I start with a Visio drawing and use Diagram.NET to modify it. One of the modifications that I am doing is to change a Shapesheet 1-D Endpoints using the following code:

case "Y1":
	// If this is a shape with 1-D Endpoints (a line)
	if (shape.OneD)
		// If this is a change relative to the current BeginY,
		// add the evaluated value to the BeginY.
		if (kvp.Value.ChangeType == ShapeChange.ChangeTypes.Relative)
			shape.XForm1D.BeginY.Value += value.AsNumber();

		// If this is a change absolute set the BeginY to the evaluated value.
		else if (kvp.Value.ChangeType == ShapeChange.ChangeTypes.Absolute)
			shape.XForm1D.BeginY.Value = value.AsNumber();

		// If the change type is none, display a Warning
			DisplayLogMessage($" WARNING: {shape.Name} handle={shape.ID} Y1 does not support a type of none.");
	// If the shape does not have 1-D Endpoints, display an error.
	DisplayLogMessage($" ERROR: {shape.Name} handle={shape.ID} does not support Y1.");

As an example, using the drawing in Image1-Diagram A as my source, I change the BeginY value of the top line.

When I open the resulting drawing in Visio, Image1-Diagram B, the shape does not appear to have changed, although the Begin point handle has moved.

When I nudge the End point, the shape is refreshed, and the Begin point moves to the position I had set it to in my code, Image1-Diagram C.

What do I have to do to get the drawing to refresh the end point?

I suspect that it has something to do with how OPC recalculates the file when it opens as per https://docs.microsoft.com/en-us/office/client-developer/visio/how-to-manipulate-the-visio-file-format-programmatically#recalculate-data-in-the-file

Is there a flag I have to set or procedure I have to call to get the drawing to refresh?

Image1.png (257.4 KB)

Edit: I also tried adding a shape.RefreshShape() as per https://docs.aspose.com/diagram/net/refresh-shapes-data/ and this move the center point of the line but did not update the geometry. See Image 2.

Image 2.png (17.9 KB)


Can you please share the sample Diagram file with us as well so that we can test the scenario in our environment and address it accordingly?

Hi Asad,

Sorry for the delay, yesterday was a statutory holiday here. I’ve attached the original Visio drawing.

image001.png (1.92 KB)



We have logged an issue as DIAGRAMNET-52667 in our issue tracking system for further investigation. We will look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.

We are sorry for the inconvenience.

@asad.ali has any progress been made on this?


We would like to share with you that the ticket will be resolved in 22.3 version of the API which will be published soon. We will send you notification when this version is out.

The issues you have found earlier (filed as DIAGRAMNET-52667) have been fixed in this update. This message was posted using Bugs notification tool by philip.zhou