Upload Native File for CAD Document

オフライン

Hello,

I am trying to upload a native file for a CAD Document via Batch Loader but I have been receiving an error and am not sure how to fix it or don't know what would be wrong. I'm wondering if someone could help me for this matter. Thank you very much in advance for any help.

<Item type='CAD' action='add'>

  <id>
    <Item type='CAD' action='get' select='id'>
      <keyed_name>@1</keyed_name>
    </Item>
  </id>
  <native_file>
    <Item type='File' action='add' select='id'>
      <actual_filename>@2</actual_filename>
      <filename>@3</filename>
    </Item>
  </native_file>
</Item>

CAD Document ID: 43C9E89F5BC140BF843DDF392D47C88D (Should I use CAD Document Number 50104-DRW?)

Native File: full path file location

File Name: X.SLDDRW

Error:

[3:57:12 PM]: Start batch load
[ *** Worker process for lines 2 - 2 *** ]:
[3:57:13 PM Worker process for lines up to 1 (Thread #1)]: Logged in
[3:57:14 PM Worker process for lines up to 1 (Thread #1)]: #1 - <Item type="CAD" action="add"><id><Item type="CAD" action="get" select="id"><keyed_name>43C9E89F5BC140BF843DDF392D47C88D</keyed_name></Item></id><native_file><Item type="File" action="add" select="id"><actual_filename>V:\Company\ERP\Internal\Batch Loader - Engineer\BatchLoader - PLM SP15 Test\Test Adding CAD Native File</actual_filename><filename>X.SLDDRW</filename></Item></native_file></Item>
[3:57:14 PM Worker process for lines up to 1 (Thread #1)]: #1 - <Fault>
[3:57:14 PM Worker process for lines up to 1 (Thread #1)]: <SOAP-ENV:Envelope xmlns:SOAP-ENV="">schemas.xmlsoap.org/.../"><SOAP-ENV:Body><SOAP-ENV:Fault xmlns:af="">www.aras.com/.../faultcode><faultstring><![CDATA[No items of type CAD found.]]></faultstring><detail><af:legacy_detail><![CDATA[No items of type CAD found.]]></af:legacy_detail><af:legacy_faultstring><![CDATA[No items of type 'CAD' found using the criteria:
<Item type="CAD" action="get" select="id" doGetItem="0"><keyed_name>43C9E89F5BC140BF843DDF392D47C88D</keyed_name></Item>
]]></af:legacy_faultstring></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
[3:57:14 PM Worker process for lines up to 1 (Thread #1)]: Finished
 processed successfully - 0
 average processed request time - 0 ms
 failed to process - 1
 total time - 0 sec
[3:57:14 PM]: Finish batch load: succeeded - 0; failed - 1

  • Hello There,

    I am trying to load a native file to a CAD Document so I am using the below AML script and didn't get an error but for some reason my native file still not being uploaded instead it kept adding new CAD Documents. I'm wondering if someone could advise me what I did wrong. Thank you very much in advance for any help.

    <Item type="PART CAD" action="add">
    <source_id>
    <Item type="Part" action="get">
    <id>@1</id>
    </Item>
    </source_id>
    <related_id>
    <Item type="CAD" action="get">
    <item_number>@2</item_number>
    </Item>
    <native_file>
    <Item type="File" action="add">
    <actual_filename>@3</actual_filename>
    <filename>@4</filename>
    </Item>
    </native_file>
    </related_id>
    </Item>

    LOG:

    [11:56:45 AM]: Start batch load

    [ *** Worker process for lines 2 - 2 *** ]:

    [11:56:46 AM Worker process for lines up to 1 (Thread #1)]: Logged in
    [11:56:46 AM Worker process for lines up to 1 (Thread #1)]: #1 - <Item type="PART CAD" action="add"><source_id><Item type="Part" action="get"><id>8732114AFE484F03B5C83685CDC56D22</id></Item></source_id><related_id><Item type="CAD" action="get"><item_number>50104-DRW</item_number></Item><native_file><Item type="File" action="add"><actual_filename>V:\Company\ERP\Internal\Batch Loader - Engineer\BatchLoader - PLM SP15 Test\Test Adding CAD Native File</actual_filename><filename>X.SLDDRW</filename></Item></native_file></related_id></Item>
    [11:56:46 AM Worker process for lines up to 1 (Thread #1)]: <SOAP-ENV:Envelope xmlns:SOAP-ENV="">schemas.xmlsoap.org/.../"><SOAP-ENV:Body><Result><Item type="Part CAD" typeId="935DF68BCFD849EBB5C3A528F04C5B5B" id="FC542ADFC8B94A1BB7958133A1F028B2"><behavior>hard_float</behavior><config_id keyed_name="FC542ADFC8B94A1BB7958133A1F028B2" type="Part CAD">FC542ADFC8B94A1BB7958133A1F028B2</config_id><created_by_id keyed_name="Super User" type="User">AD30A6D8D3B642F5A2AFED1A4B02BEFA</created_by_id><created_on>2020-12-07T11:56:46</created_on><generation>1</generation><id keyed_name="FC542ADFC8B94A1BB7958133A1F028B2" type="Part CAD">FC542ADFC8B94A1BB7958133A1F028B2</id><is_current>1</is_current><is_released>0</is_released><keyed_name>FC542ADFC8B94A1BB7958133A1F028B2</keyed_name><major_rev>A</major_rev><modified_by_id keyed_name="Super User" type="User">AD30A6D8D3B642F5A2AFED1A4B02BEFA</modified_by_id><modified_on>2020-12-07T11:56:46</modified_on><new_version>1</new_version><not_lockable>0</not_lockable><permission_id keyed_name="New Part" type="Permission">5C07EB829D4241F6BB884952960FAF58</permission_id><sort_order>640</sort_order><source_id keyed_name="50104 SpRng pin 5/64×.5" type="Part">8732114AFE484F03B5C83685CDC56D22</source_id><related_id><Item type="CAD" typeId="CCF205347C814DD1AF056875E0A880AC" id="43C9E89F5BC140BF843DDF392D47C88D"><authoring_tool>Solidworks</authoring_tool><awb_minor_rev>1</awb_minor_rev><config_id keyed_name="50104-DRW Mechanical/Drawing Spring pin 5/64&quot;×1/2&quot;" type="CAD">43C9E89F5BC140BF843DDF392D47C88D</config_id><created_by_id keyed_name="Innovator Admin" type="User">30B991F927274FA3829655F50C99472E</created_by_id><created_on>2016-12-02T15:40:29</created_on><current_state name="In Change" keyed_name="In Change" type="Life Cycle State">19853E4D3985483B93BBFCCE7052E38B</current_state><description>Spring pin-5/64×1/2</description><effective_date>2020-11-19T14:24:49</effective_date><epdm_is_submitted>0</epdm_is_submitted><generation>1</generation><has_change_pending>1</has_change_pending><id keyed_name="50104-DRW Mechanical/Drawing Spring pin 5/64&quot;×1/2&quot;" type="CAD">43C9E89F5BC140BF843DDF392D47C88D</id><is_current>1</is_current><is_released>1</is_released><is_standard>0</is_standard><is_template>0</is_template><keyed_name>50104-DRW Mechanical/Drawing Spring pin 5/64"×1/2"</keyed_name><locked_by_id keyed_name="Super User" type="User">AD30A6D8D3B642F5A2AFED1A4B02BEFA</locked_by_id><major_rev>A</major_rev><modified_by_id keyed_name="Super User" type="User">AD30A6D8D3B642F5A2AFED1A4B02BEFA</modified_by_id><modified_on>2020-12-07T11:12:40</modified_on><new_version>1</new_version><not_lockable>0</not_lockable><permission_id keyed_name="In Change CAD" type="Permission">718FEFE9B85D4E6998F40DFADDE46442</permission_id><release_date>2020-11-19T14:24:49</release_date><state>In Change</state><item_number>50104-DRW</item_number><classification>Mechanical/Drawing</classification><name>Spring pin 5/64"×1/2"</name><itemtype>CCF205347C814DD1AF056875E0A880AC</itemtype></Item></related_id></Item></Result><Message><event name="ids_modified" value="8732114AFE484F03B5C83685CDC56D22" /></Message></SOAP-ENV:Body></SOAP-ENV:Envelope>
    [11:56:46 AM Worker process for lines up to 1 (Thread #1)]: Finished
    processed successfully - 1
    average processed request time - 15.6289 ms
    failed to process - 0
    total time - 0.0156289 sec
    [11:56:47 AM]: Finish batch load: succeeded - 1; failed - 0

    Regards,

    Jakk

  • Hello,

    I was able to load my native file to a CAD Document so I would like to share my AML script with someone who might be in the same situation like me. 

    <Item type="Part CAD" action="add">  

      <source_id>@1</source_id>  (You can find this id from Part (id) or Part CAD (Source id) Tables: 

      <related_id>

        <Item type="CAD" select="id" action="edit" id="@2"> (You can find this id from Part CAD (Related id)

          <native_file>

            <Item type="File" action="add">

              <filename>@3</filename>  (Actual file name)

              <actual_filename>@4</actual_filename> (Actual file path)

              <Relationships>

                <Item type="Located" action="add">

                  <related_id>XXXX</related_id> (The default VAULT id)

                </Item>

              </Relationships>

            </Item>

          </native_file>

        </Item>

      </related_id>

    </Item>

    I hope this AML Script would be useful for someone who is trying to load a native file.

    Regards,

    Jakk

  • オフライン in reply to Jakk

    Hi Jakk

    I tried to use same AML but i am getting error as "File Item cannot be added."

    In My case only change is, instead of Native file i am working on Viewable.

    Please suggest

  • オフライン in reply to sameerbaji

    Hello Sameer,

    I tested it on my end and it worked. Please see the script below:

    <Item type="Part CAD" action="add">
    <source_id>@1</source_id>
    <related_id>
    <Item type="CAD" select="id" action="edit" id="@2">
    <viewable_file>
    <Item type="File" action="add">
    <filename>@3</filename>
    <actual_filename>@4</actual_filename>  (Actual file name)
    <Relationships>
    <Item type="Located" action="add">  (Actual file path)
    <related_id>67BBB9204FE84A8981ED8313049BA06C</related_id> (The default VAULT id)
    </Item>
    </Relationships>
    </Item>
    </viewable_file>
    </Item>
    </related_id>
    </Item>