Drawing a simple line between two points

dear aspose.diagram support.


I am trying to draw a simple straight line between two points.

I can add a line shape, then modify the Xform.PinX, Xform.PinY and Xform.angle parameters to get it positioned correctly. Unfortnately I cant change the width ( bug already reported earlier ) so I cant achieve this currently.

But this whole procedure is rather cumbersome, is there no simpler way to draw a straight line ??

thanks for your thoughts,

guido

ok, I think I can do this best by adding connectors between shapes.


So I have added some points in my original Visio.
I am now opening the Visio in VB using aspose.diagram.

Now it seems that when I open the diagram in VB, the connections that were active in Visio are not present anymore.

I have attached the original Visio file.

Please advise - probably i am doing something stupid

guido

I have appended the associated Visual STudio project.

In Visio the circle are connected.
After opening them with Aspose.Diagram, they are not connected anymore


Hi Guido,


Please accept our apologies for the delay. We are working over your query and will get back to you as soon as possible.

Hi Guido,

Thanks for the inquiry. Could you please explain the source code below? Because it is creating a confusion. I mean to say what you are expecting after this source code execution. Also, I would like to update you that there is a documented link. It will help to add the shapes and connect them. Please visit the documentation page here.

Source code:

Dim a1 As Single = shape.Shapes(4).XForm.PinX.Value - shape.Shapes(4).XForm.Height.Value / 2

Dim a2 As Single = shape.Shapes(4).XForm.PinX.Value + shape.Shapes(4).XForm.Height.Value / 2

shape.Shapes(6).XForm.PinX.Value = a1

shape.Shapes(7).XForm.PinX.Value = shape.Shapes(4).XForm.PinX.Value

shape.Shapes(9).XForm.PinX.Value = a2

I hope this will help you.

hello,


The code you indicated in your mail is not important for my question.

The problem is that I have a Visio source file which contains shapes that are connected with a connector. That means that the connector line automatically adjusts when the shape is moved to a different position.

When this Visio source file is read into Visual Studio using the Aspose.Diagram library, it seems that the connectors are not present anymore - when a shape that had a connector onto it is moved ( see the code in the code extract ), the connector lines do not move with it but remain static. This can be seen when printing the diagram.

The connectors should follow the shapes, as in Visio.

Hope this clarifies my problem.

Hi Guido,


Thanks for the clarification. I managed to replicate the problem. In addition, when I tried to save it as a VDX file format. It is showing me an error message. I have logged the following issues in our issue tracking system.

DIAGRAM-33361: Aspose.Diagram does not allow the connectors to move around the child shape when the shape is moved
DIAGRAM-33362: Aspose.Diagram produces an invalid XML during open/save ( VSD to VDX )

Your request has also been linked to these issues and you will be notified as soon as these are resolved and available for the public use. We’re sorry for the inconvenience.

Hi Guido,

Good news for you is DIAGRAM-33361 has now been resolved and its fix will be included in the next version of Aspose.Diagram for.NET (3.2.0). Which is expected to be released at the start of May 2013. We will inform you via this forum thread as soon as the new release is published.

hi,

for my planning purposes, can you please advise when revision 3.2.0 will be made available ?
thanks
guido

Hi Guido,


Thanks for your inquiry. Aspose.Diagram 3.2.0 was expected at the start of May 2013 but due to some bug fixes we shifted it a bit. Now it is expected to be released after one or two weeks. We’re sorry for your inconvenience.

The issues you have found earlier (filed as DIAGRAM-33361) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

The problem still has not been fixed.

When I move a porint that has a connector between, the resulting connector still does not move when handled through Aspose.Diagram

this is the code ( VB .NET )
Dim license As Aspose.Diagram.License = New Aspose.Diagram.License()
license.SetLicense(“F:\Aspose Licenses\Aspose.Diagram.lic”)
Dim x As New Aspose.Diagram.Diagram(“C:\trend.vsd”)
Dim y As Aspose.Diagram.Shape = x.Pages(0).Shapes(0).Shapes(7)
rem delete the line below as needed
y.XForm.PinY.Value = 10
x.Save(“C:\x.pdf”, Aspose.Diagram.SaveFileFormat.PDF)

Can you please check ?

thanks

guido

Hi Guido,

Thanks for your inquiry. I’m sorry about this inconvenience. You need to use the new shape’s method Move. Please follow up the following source code below:

Public Sub TestMoveChildGroupShape()
Dim fileName As String = “trend.vdx”
Dim diagram As New Diagram(filePath + “Manipulating” fileName)
diagram.Save(tempFolder“trend.png”, SaveFileFormat.PNG)
diagram.Pages(0).Shapes(0).Shapes(7).Move(-8,8)
diagram.Save(tempFolder“trend1.png”, SaveFileFormat.PNG)
diagram.Pages(0).Shapes(0).Shapes.GetShape(8).Move(-12,-8)
diagram.Save(tempFolder“trend2.png”, SaveFileFormat.PNG)
diagram.Pages(0).Shapes(0).Shapes.GetShape(11).Move(-5,-8)
diagram.Save(tempFolder“trend3.png”, SaveFileFormat.PNG)
diagram.Pages(0).Shapes(0).Shapes(7).Move(5,-5)
diagram.Save(tempFolder “trend4.png”, SaveFileFormat.PNG)
End Sub

Please let me know in case of further assistance or questions.

Great, it wprks now ! Thanks for this great support !

Hi Guido,


Thanks. Please let us know any time you have any further queries. We are always glad to help you.

It seems the porblem is not completely resolved.


When I create a complex shape and try to move the subshapes, it works.

However, when I save this shape as a stencil for multiple use, and include an instance of the object from the stencil into my Visio drawing, the move command does not work anymore on the subshape.

Any ideas ?

guido

to add to my previous post - the move command works, but the connections get lost when you do this through a stencil.


guido


I have appended a stencil and resulting Visio test file

Just try to move one of the original circles ( code below ), you will see that the connectors so not follow.

Dim license As Aspose.Diagram.License = New Aspose.Diagram.License()
license.SetLicense("F:\Aspose Licenses\Aspose.Diagram.lic")
Dim x As New Aspose.Diagram.Diagram("C:\x.vsd")
x.Save("C:\x0.pdf", Aspose.Diagram.SaveFileFormat.PDF)
For Each vorm As Aspose.Diagram.Shape In x.Pages(0).Shapes
vorm.Shapes(6).Shapes(2).Move(0, 10)
Next vorm

thanks

guido

npw with attached file

Hi Guido,


Thanks for your inquiry. I managed to replicate the problem. I have logged this issue under ticket id DIAGRAM-33395 in our issue tracking system. Your request has also been linked to this issue and you will be notified as soon as it is resolved and available for the public use. We’re sorry for the inconvenience.

Did you try using the .vdx file format? Because the latest release of Aspose.Diagram 3.2.0 works perfect with .vdx file format. So as a workaround you can open .vsd file in MS Visio and then save as .vdx file format. I hope it helps.