Free Support Forum - aspose.com

Get shape prop by name


#41

@susanktuvell

We have further investigated about your requirements. Please use following code snippet to catch ‘No Formula’ value:

if (prop.Type.Ufe.F == "No Formula") {
 // do your work
} 

We regret to share that we may not be able to implement this functionality as;

“No Formula” means that there is no formula in this prop’s value;
such as <Cell N='Type' V='0' F='No Formula'>

And “0” means that the formula of the prop’s value is “0” but it’s type value is 0.
such as <Cell N='Type' V='0' F='" 0"'>

Our other users who are already working with existing enum, may face other issues if we implement this. However, above shared code snippet can fulfill your requirements. In case you have further concerns, please feel free to let us know.


#42

Hi! The
if (prop.Type.Ufe.F == “No Formula”) {
// do your work
}
call would be perfectly fine, however it does not appear to work. I am not able to get inside the condition. Do i need to update my version of the library? I do not see a new release available via NuGet.


#43

Ufe does not seem to update or get any value at all when debugging.


#44

@susanktuvell

We are checking this and will share our feedback with you soon.


#45

@susanktuvell

Would you please try using above shared code snippet with Aspose.Diagram for .NET 19.3 and share your feedback.


#46

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


#47

Hi! YES! this all works! Thank you!!!

As a small question, is there a reason that shape.InheritProps is NOT in the same order as the props on the shape sheet? What order it is in, i can’t seen to see a pattern.


#48

@susanktuvell

Thanks for your feedback.

We are checking details at our end and will share our feedback with you shortly.


#50

@susanktuvell

shape.InheritProps is inherited from the master props, so its order is based on it.


#51

Is there a way to add a property on each prop that indicates it’s line ID? I would like to be able to order the props list based on the order in which they appear in the shapesheet.


#52

@susanktuvell

We are checking your requirements and will get back to you soon.


#53

@susanktuvell

We will try to introduce following property in 19.4 version of the API:

A property  "IX" in  prop
/// <summary>
///  The zero-based index of the element within its parent element.
/// </summary>
public int IX

#54

Hi! I’m having another issue. When trying to access custom props for a shape, I am trying to write out information about those shapes. For example shape.prop.Value.Val. I get the value in that cell when it is a string, however when it is an int, I get back an empty string instead of the value. Please see attached to see an example of the document I am working work. I am trying to access the value 98 on the ExecutionOrder prop on shape #1. Aspose_Test.zip (286.8 KB)


#55

@susanktuvell

Could you please try the scenario using Aspose.Diagram for .NET 19.4 as we have tested with it and found no issue. The value was returned correctly using following code snippet:

Aspose.Diagram.Diagram diagram = new Diagram.Diagram(dataDir + "Aspose_Test.vsd");
Aspose.Diagram.Page page = diagram.Pages[0];
Aspose.Diagram.Shape shape = page.Shapes.GetShape(1);
var val = shape.Props[0].Value.Val; 

#56

Hi! I am using version 19.4 for .NET. I can easily get the Value of the prop when that value is a string. However in the instance of prop.ExecutionOrder, the value is 98. I cannot get that value back with Value.Val, I am simply returned an empty string, “”.


#57

@susanktuvell

Could you please share trimmed down sample code snippet which you are using to determine the value for mentioned prop.


#58

foreach (Prop prop in shape.InheritProps)
{
file.WriteBSTRString(“Prop.” + prop.Name);
file.WriteBSTRAsQuotedString(prop.Label.Value);
file.WriteBSTRAsQuotedString(prop.Prompt.Value);
if (prop.Type.Ufe.F == “No Formula”)
{
file.WriteBSTRString("");
}
else
{
file.WriteBSTRAsQuotedString(((int)prop.Type.Value).ToString());
}
if (prop.Value.Ufev.F == “No Formula”) **
** {

** file.WriteBSTRString("");**
** }**
** else**
** {**
** file.WriteBSTRAsQuotedString(prop.Value.Val);**
** }**
file.WriteBSTRString(prop.Format.Value);
}


#59

Hi! I also ran into an issue when getting the PinY and Height of a shape. I am looking at shape.XForm.Height.Ufe.F looking to get back the formula. However when I try to get the PinY and Height, I get “Inh” returned to me rather than the formula. PinX and Width however DO return the formula. Do you have any idea what is happening there?

Suzie


#60

@susanktuvell

Thanks for providing the details.

We were able to notice the issue in our environment while checking the values of Shape.InheritProps. However, when we tried Shape.Props, the integer value for ExecutionOrder label was returned correctly. You may please try using previously shared code.

We have logged an issue as DIAGRAMNET-51638 in our issue tracking system for InheritProps related behavior and will let you know as soon as we have any update regarding its investigation.

Regarding above issue, we were also able to replicate this in our environment and for further investigation, it has been logged under the ticket ID DIAGRAMNET-51639 in our issue tracking system. We will surely keep you posted with its rectification status. Please spare us little time.

We are sorry for the inconvenience.


#61

Hi! Thanks for the response. The reason I am looping through shape.InheritProps instead of shape.Props is because of a previous recorded issue I brought up regarding shape.Props. I noticed that shape.Props only returns SOME of the shape properties, but not all. For example on Shape #1, there are 20 properties. When I call shape.Props i only get 7 (not sure of the exact number), versus all 20. So that’s why I’m looping through shape.InheritProps, not shape.Props. So although it may work on shape.Props it does not work on shape.InheritProps. I’m not attached to HOW I get the props of a shape. I just want to get all of the props and all of the prop info. thanks!