Free Support Forum - aspose.com

How to create shape data properties?

I want to add few shape properties to one of the shape in the diagram. How can i do that?


I use the below code, but no luck. Can you please help me on this?

foreach (var attr in projectSwimlaneEntity.AttributeList)
{
Prop prop = new Prop() { Name = attr.AttributeName };
prop.Label.Value = attr.AttributeName;
prop.Value.Val = attr.AttributeValue;
entity.Master.Shapes[0].Props.Add(prop);
}

Hi Sanjay,


Thank you for contacting support. Please use the following sample code:

[C#]

// Load diagram<o:p></o:p>

Diagram diagram = new Diagram(@"C:\temp\Drawing1.vsd");

// iterate through shapes

foreach (Aspose.Diagram.Shape shape in diagram.Pages[0].Shapes)

{

// select a shape

if (shape.Name == "Square")

{

//Initialize a new property object

Prop prop = new Prop();

prop.Name = "Prop Name";

prop.Label.Value = "Prop Name";

prop.Value.Val = "attribute value";

// add shape data item

shape.Props.Add(prop);

break;

}

}

diagram.Save(@“C:\temp\Output.vdx”,
SaveFileFormat.VDX);


We hope, this helps. Please feel free to reply us in case of any confusion or questions.

It doesn’t work. Hence I have attached a test project file for your ref.


There are couple of things i want achieve
1. Add properties to each shape.
2. Set swimlane text on the swimlane, even that doesn’t seem to be working. :frowning:


Hi Sanjay,


We are working over your inquiry and will get back to you soon.

Hi Sanjay,


Thank you for being patient. We can notice the problem of properties not being added properly. We have logged this issue under ticket id DIAGRAMNET-50226 in our issue tracking system. We’ll keep you informed regarding any available updates. We’re sorry for the inconvenienced you faced.
koppikar:
2. Set swimlane text on the swimlane, even that doesn’t seem to be working. :frowning:
We’re sorry to share with you that we could not notice this problem. The swimlane text is added. We have attached the output VDX file for your reference. Please highlight this issue using the screenshot. Also, please always share the filtered sample code there. It helps us to quickly sort out the said issues.

Is there any update on this? DIAGRAMNET-50226?

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


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

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


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

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


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

The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for JasperReports 18.3 update.