Save a drawing as PDF with 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 ID of this drawing's PDF file. This is the PDF file name.

  3. Get a specific display set to obtain its SP_ID.

  4. Apply the display set to the drawing. This request requires the drawing's SP_ID and the display set's SP_ID as part of the input.

  5. Download the drawing file to save the drawing as a .pdf file. This request requires the .pdf file identifier, generated in the previous request, 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.

Get specific PDF ID

  1. To view all the available files related to the required drawing, select the request 08.04 Get drawing files with the drawing's SP_ID value you obtained from the previous request's response and click Send.

    GET

    https://apiservername.domain.com/WebApi/SPID/V2/Sites('WEBAPISITE001')/Plants('PLANT001')/
    Drawings('75A7E51BA85C40E8873708323B74FA7E')/Files

  2. From the response, copy the required .pdf file's ID value.

Get specific display set

The display set name Sec Pipe in the request below is an example only. You can select a different display set to retrieve.

  1. To view all the available display sets in the plant, select the request 08.05 Get display sets and click Send.

    GET

    https://apiservername.domain.com/WebApi/SPID/V2/Sites('WEBAPISITE001')/Plants('PLANT001')/
    DisplaySets?$count=true

    SHARED Tip If you already know the name of the display set you want to apply, select the request 08.06 Get specific display set and click Send.

    GET

    https://apiservername.domain.com/WebApi/SPID/V2/Sites('WEBAPISITE001')/Plants('PLANT001')/
    DisplaySets?$filter=Name eq 'Sec Pipe'

  2. From the response, copy the SP_ID value of the Sec Pipe display set.

Apply display set to drawing

  1. Select the request 08.07 Apply display set.

    POST

    https://apiservername.domain.com/WebApi/SPID/V2/Sites('WEBAPISITE001')/Plants('PLANT001')/
    Drawings('75A7E51BA85C40E8873708323B74FA7E')Com.Ingr.SPID.V2.ExecuteDisplaySet/

  2. In the Body of the request, enter:

    "DisplaySetID": "7043200FBEBE4BBFA6044BF0C6C2A8C9"

  3. Click Send.

  4. 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, enter the value of the PDF file's ID (file name) obtained from the response to the request 08.04 Get drawing files.

  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.07 Apply display set.

  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='f76ff8a0-adba-459f-986e-b715df9a1496')

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