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

Free Support Forum - aspose.com

Add text to Pool

Hi Team!! Thanks for all your help,

I am creating a pool / Lane from Aspose to Visio File, I need put the text in the pool text, but with your example it appears in the center of shape.

this is my code

shapeId = diagram.AddShape(3.5, 9.5,7,3, @"Pool / Lane", 0);
shape = diagram.Pages[0].Shapes.GetShape(shapeId);
shape.Text.Value.Add(new Txt(@"Pool."));

Additionally,, if I try to modify the text in visio (out_file) I can't.



Hi Consu,

Thank you for contacting support. We are working over your query and will get back to you soon.

Hi Consu,

Thank you for being patient. You are placing a group shape (Pool / Lane) in the Visio drawing. Your code sample adds text to the group shape. To get the required result, you can iterate through the sub-shapes, and then set the text of left hand sub-shape. You can iterate through the sub shapes as below:

[.NET, C#]

shapeId = diagram.AddShape(3.5, 9.5, 7, 3, @“Pool / Lane”, 0);
shape = diagram.Pages[0].Shapes.GetShape(shapeId);
foreach (Aspose.Diagram.Shape subshape in shape.Shapes)
subshape.Text.Value.SetWholeText(“My Text”);

Please let us know in case of any further assistance or questions.

Thanks for your answer!!

If you do it with a foreach, all the forms will have the text, but you have given me an idea and I did it as follows:

If (shape.Shapes.Count> 0)

Shape.Shapes [1].Text.Value.SetWholeText ("My Text");

Other think... when I Try to edit this text in the visio file, I can't.



The issues you have found earlier (filed as DIAGRAMNET-51161) have been fixed in Aspose.Diagram for .NET 17.3.0.

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