GetObjectFileAttachments Method - SmartPlant Foundation - IM Update 44 - Customization & Programming - Hexagon

SmartPlant Foundation Customization

Language
English
Product
SmartPlant Foundation
Search by Category
Customization & Programming
SmartPlant Foundation / SDx Version
10

Retrieves all the files attached to the object defined by the classdef and name. There is another parameter that only returns viewable files.

The reply is shown below for each file you are given OBID, Name and Description, the OBID can be used to get a viewable version of the file.

Inputs

  • ClassDef

  • Name

  • Include viewable files only.

Dim lobjDownloadService As New DownloadService.DownloadSoapClient

Dim lobjResponse As DownloadService.XFRDataTransfer = lobjDownloadService.GetObjectFileAttachments(lblSessionId.Text, cboFAClassDef.Text, txtFAName.Text, chkViewable.Checked)

Outputs

XFRDataTransfer and when it has serialized, the output looks like this (see below). Each file is an item and using the OBID, another web method like ViewFileUsingVirtualFilePath can be used to get a URL to the viewable version of the file.

<XFRDataTransfer SourceUTCDateYYYYMMDD="2010/02/05-14:15:28:982" Description="File attachments for DEVPurchaseOrder PODoc-003" Source="GetObjectFileAttachments">

<XFRConfiguration Plant="" xmlns="http://localhost/SPF40Server/" />

<XFRItems xmlns="http://localhost/SPF40Server/">

<XFRItem N="" C="">

<XFRA V="BLK000A" N="OBID" />

<XFRA V="Doc1.txt" N="Name" />

<XFRA V="My new file desc" N="Description" />

</XFRItem>

<XFRItem N="" C="">

<XFRA V="BLL000A" N="OBID" />

<XFRA V="Doc2.txt" N="Name" />

<XFRA V="My new file desc" N="Description" />

</XFRItem>

</XFRItems>

</XFRDataTransfer>