Save a drawing as PDF without applied display set - Intergraph Smart P&ID - 2.0 - Customization & Programming - Hexagon

Intergraph Smart P&ID Web API Help

Language
English
Product
Intergraph Smart P&ID
Subproduct
Web API
Search by Category
Customization & Programming
Smart P&ID Web API Version
2.0
Smart Electrical Web Version
2.0.1

To save a drawing as a .pdf file, run the following requests:

  1. Get the SP_ID of the required drawing.

  2. Get the unique identifier (Id value) of the drawing's PDF file by retrieving the file Uri. This request requires the drawing's SP_ID value as part of the input.

  3. Download the drawing file to save the drawing as a .pdf file. This request requires the PDF file's unique identifier and file name as part of the input.

Get drawing's SP_ID

The SP_ID value and the drawing name DEMO_01 in the requests below are examples only. You can select a different drawing to retrieve.

  1. Launch Postman.

  2. To view all the available drawings in the plant, select the request 08.01 Get drawings and click Send.

    GET

    https://apiservername.domain.com/WebApi/SPID/V2/Sites('WEBAPISITE001')/Plants('PLANT001')/
    Drawings/Com.Ingr.SPID.V2.WEBAPISITE001.PLANT001.Drawing/?$select=SP_ID,Name$count=true

    A typical response appears as follows:

    SHARED Tip If you already know the name of the specific drawing you want to save as a .pdf file, select the request 08.02 Get specific drawing, enter the drawing name, and click Send.

    GET

    https://apiservername.domain.com/WebApi/SPID/V2/Sites('WEBAPISITE001')/Plants('PLANT001')/
    Drawings/Com.Ingr.SPID.V2.WEBAPISITE001.PLANT001.Drawing/?$select=SP_ID,Name&$filter=Name eq 'DEMO_01'

  3. From the response, copy the drawing's SP_ID value.

Retrieve file unique identifier

  1. Select the request 08.03 Retrieve file URI and paste the SP_ID value and the file name you obtained from the previous request's response into the syntax shown below.

    POST

    https://apiservername.domain.com/WebApi/SPID/V2/Sites('WEBAPISITE001')/Plants('PLANT001')/
    Drawings('75A7E51BA85C40E8873708323B74FA7E')/Files('DEMO_01.pdf')/
    Com.Ingr.Core.V1.RetrieveFileUri/

    In the request, the file name must include the .pdf file extension.

  2. Click Send.

  3. From the response, copy the PDF file's unique identifier (Id value).

Download drawing file

  1. Select the request 08.08 Get file result.

  2. For the Files parameter, paste the string obtained for the PDF file's FileId value (file name) from the response to the request 08.03 Retrieve file URI.

  3. For the resultId parameter, paste the string obtained for the PDF file's unique identifier (Id value) from the response to the request 08.03 Retrieve file URI.

  4. Click Send and Download.

    The value of the string shown below is an example only.

    GET

    https://apiservername.domain.com/WebApi/SPID/V2/Sites('WEBAPISITE001')/Plants('PLANT001')/
    Drawings('75A7E51BA85C40E8873708323B74FA7E')/Files('DEMO_01.pdf')/
    Com.Ingr.Core.V1.GetRetrieveFileUriResultAsync(resultId='e96cb6aa-4622-4bcd-80e8-689b777ce97d')

  5. Save the file to the required location with the name of your choice, including a .pdf extension.