Resizing the lateral line shape

I created a new visio diagram and added one shape: lateral line [as I understand this shape comes with Visio]. I modified ChangeShapeSize.java from the examples project to use this object, but it doesn’t resize it at all - the only result is that the form is broken. How can I resize this object?

Regards, Łukasz

@Lukasz_Dobrzynski
Please refer to this link of docs:
Set Visio Shape's XForm, Line and Fill Data|Documentation.
If you still have problems, please provide your sample files and code, we will check it soon.
Thanks.

Hi @philip.zhou, this is the code I’m using. It’s just slightly modified [paths and ids] class from your git repository:

package com.aspose.diagram.examples.Shapes;

import com.aspose.diagram.Diagram;
import com.aspose.diagram.Page;
import com.aspose.diagram.SaveFileFormat;
import com.aspose.diagram.Shape;
import com.aspose.diagram.examples.Utils;

public class ChangeShapeSize {

public static void main(String[] args) throws Exception {
    // ExStart:ChangeShapeSize
    // The path to the documents directory.
    String dataDir = "C:\\";

    // call a Diagram class constructor to load the VSDX diagram
    Diagram diagram = new Diagram(dataDir + "Drawing1.vsdx");
    // get page by name
    Page page = diagram.getPages().getPage("Page-1");
    // get shape by id
    //        Shape shape = page.getShapes().getShape(796);
    Shape shape = page.getShapes().getShape(1);
    // alter the size of Shape
    shape.setWidth(10 * shape.getXForm().getWidth().getValue());
    shape.setHeight(2 * shape.getXForm().getHeight().getValue());
    // save diagram
    diagram.save(dataDir + "ChangeShapeSize_Out.vsdx", SaveFileFormat.VSDX);
    // ExEnd:ChangeShapeSize
}

}

As you can see the in the output file size is not changed and the form is broken. Should I not be using setWidth/setHeight to resize this object? I don’t see any reference to those methods and any resizing in the link you provided. pack.zip (26.2 KB)

@Lukasz_Dobrzynski

We have logged an investigation ticket as DIAGRAMJAVA-50951 in our issue tracking system to further analyze this case. We will look into ticket detail and let you know once it is resolved. Please be patient and spare us some time.

We apologize for the inconvenience.

The issues you have found earlier (filed as DIAGRAMJAVA-50951) have been fixed in this update. This message was posted using Bugs notification tool by philip.zhou

Hi @philip.zhou, well - the line got resized, yes. But:

  • The form doesn’t cover the whole line now, both ends are somewhere in the middle [at the original positions?] - should I have to add it to the code?
  • When I open the diagram I can no longer resize the line or rotate it or move it…

BR, LD

@Lukasz_Dobrzynski

We have recorded your concerns under the ticket and will perform investigation. We will let you know once we have some feedback.

@Lukasz_Dobrzynski

We have logged another ticket as DIAGRAMJAVA-50967 in our issue tracking system against your recent feedback. We will investigate it and let you know once it is resolved. Please spare us some time.

Actually I also have the same issue with the custom stencils I add to the document - when I manually add shapes using those I can reshape them, but the ones added programmatically using the lib cannot be reshaped - when I drag the xframe only it’s size changes and the shape’s inside the frame stay the same. I assume that there can be a common cause.

@Lukasz_Dobrzynski

We have already investigated the above ticket and it will be fixed in upcoming version i.e. Aspose.Diagram for Java 22.6.

The issues you have found earlier (filed as DIAGRAMJAVA-50967) have been fixed in this update. This message was posted using Bugs notification tool by philip.zhou

Hi, I’m checking page.drawLine now and there is the same issue: I can resize the line, but then I cannot do anything with it and form is broken. https://drive.google.com/file/d/1Ps2bOZxvTVIZdIA5Fhcmy3OJ0WKt0W5m/view?usp=sharing

@Lukasz_Dobrzynski

Another ticket as DIAGRAMJAVA-51006 has been logged in our issue tracking system to investigate this issue. We will look into its details and let you know as soon as it is resolved. Please spare us some time.

We apologize for your inconvenience.

The issues you have found earlier (filed as DIAGRAMJAVA-51006) have been fixed in this update. This message was posted using Bugs notification tool by philip.zhou