Hi,
Thank you for the inquiry.
asthac:
The shape is enlarged as per text height but it always returns default height value of - 0.18888888888888888
We have tested your scenario with the latest version 17.5 of Aspose.Diagram for Java API and it does not return a negative value. Kindly confirm which Aspose.Diagram for Java API version are you using?
asthac:
Isn’t there an easier approach like setting it set from the stencil itself.
When dopping a shape manually or via automation on Visio, the formula remains intact, so cant the same thing be provided via Aspose as well?
Each shape instance is an extended form of a master and we can edit masters in the stencil files using Aspose.Diagram for Java API. When you will load your VSS stencil and modify a master, you cannot store back a stencil in VSS format. As an alternative, you can save VSS stencil in the VSSX format. Please try the following code:
[Java]
<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”>String dataDir = “C:\Diagram\test2073\”;<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”>
String visioStencil = dataDir + “XANFLOWCHARTNEW.vss”;<br style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”><span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”>Diagram diagram = <span class=“kwrd” style=“color: rgb(0, 0, 255); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>new<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”> Diagram(visioStencil);<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”>
<span class=“kwrd” style=“color: rgb(0, 0, 255); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>for<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”> (Master master : (Iterable) diagram.getMasters())<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”>
{<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”>
<span class=“kwrd” style=“color: rgb(0, 0, 255); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>if<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”>(master.getName() == “Process”)<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”>
{<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”>
master.getPageSheet().getXForm().getWidth().getUfe().setF(“GUARD(TEXTWIDTH(TheText,Height))”);<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”>
master.getPageSheet().getXForm().getHeight().getUfe().setF(“GUARD(TEXTHEIGHT(TheText,Width))”);<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”>
}<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”>
}
<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”>diagram.save(dataDir + “XANFLOWCHARTNEW_2.vssx”, SaveFileFormat.VSSX);