Skip to main content
Answer

P&ID convert to SVG, annotations map to the wrong document when multiple files are sent to the API

  • January 22, 2025
  • 2 replies
  • 62 views

Markus Pettersen
MVP

I’ve encountered a bit of an interesting issue when converting annotated P&IDs to SVG files using this endpoint from the Python SDK:

cognite_client.diagrams.convert(diagram_detect_results)

If I send in one file at a time then it works as expected:

But if I try to upload convert them at the same time then the annotations switch over for some reason. The annotation mapped to file_1 are shown on file_2 and vice versa. This also scales, but is a lot easier to demonstrate with just two files:

 

I’ve attached the diagram detect results that I send in to the API, and I can’t see any reason why this would happen. This makes parallelization somewhat difficult as we need to convert each file individually to ensure correctness.

Attachments:
daigram_res.txt contains both files at once
daigram_res_1.txt and diagram_res_2.txt contains each file as separate entities

Best answer by Que Tran

Hi,

The fix has been deployed :). Thank you again for reporting the issue, Markus!

Best regards,

Que

2 replies

Que Tran
Practitioner
Forum|alt.badge.img
  • Practitioner
  • January 22, 2025

Hi ​@Markus Pettersen ,

Thanks for reporting the issue! It does look like a bug on our end. We’ve passed it along to the team to check out. We will let you know once it’s fixed.

Best regards,
Que


Que Tran
Practitioner
Forum|alt.badge.img
  • Practitioner
  • Answer
  • January 23, 2025

Hi,

The fix has been deployed :). Thank you again for reporting the issue, Markus!

Best regards,

Que