How to export one or more diagrams to a visual paradigm project using openAPI?

Hi guys
I want to export one or more diagrams to a Visual Paradigm Project in my plugin and then import it back to another project
How to do that?
Thanks in advance

1 Like

Hi Mamad,

Thank you for your inquiry. I have forwarded your question to our team to study. When there is a reply, I will let you know.

Best regards,
Jick Yeung

Hi Mamad,

Currently, we only support exporting the entire project as XML via:
ApplicationManager.getModelConvertionManager().exportXML(project, …)

We will consider supporting the chosen diagrams. I will post again when it’s supported.

Best regards,
Jick Yeung

2 Likes

Well, thank you

You’re welcome :slight_smile:

Hey @Jick
Can you please give us an example on how to export the XML of all the project.
I thought that the “project” argument in exportXML is of type IProject. so i did somthing like this:
IProject project = ApplicationManager.instance().getProjectManager().getProject();
ApplicationManager.getModelConvertionManager().exportXML(project, new File("…"))
but project is of type “component” i don’t understand this.
and any news about exporting single diagram as XML ?
Thank you

Hi Hamza,

You don’t need to pass the project. Just pass the file would be fine.

The suggestion about exporting a single diagram as XML is still pending to be reviewed. I will post here when there is any update.

Best regards,
Jick Yeung

1 Like

Hey Jick, thanks for your replay.
When I pass the path to the VP project file, it displays a message saying that there is no diagram. But my project does.

Hi Hamza,

The path parameter is the output path of the XML file, not the project file. The API helps to export your current project to the path specified, as XML…

Best regards,
Jick Yeung

1 Like

Hey Jick, Thanks a lot

You’re welcome. :slight_smile: Feel free to contact us again if you have any other questions.

1 Like