<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.aras.com/community/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Create CAD Document using IOM API</title><link>https://www.aras.com/community/f/development/3430/create-cad-document-using-iom-api</link><description>Hi,

How can I create and attach file with a&amp;#160; CAD Document through IOM API?

Here is the code I am trying to implement.

&amp;lt;hr /&amp;gt;

// Create the CAd Document item

var docItem = MyInnovator.newItem(&amp;quot;CAD&amp;quot;, &amp;quot;add&amp;quot;);
docItem.setProperty(&amp;quot;item_number&amp;quot;, &amp;quot;CADDoc</description><dc:language>ja-JP</dc:language><generator>Telligent Community 12</generator><item><title>RE: Create CAD Document using IOM API</title><link>https://www.aras.com/community/thread/3778?ContentTypeID=1</link><pubDate>Fri, 18 Oct 2019 03:25:39 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:5f7c4a36-b2d5-4e6e-9b3d-374a2a9525f5</guid><dc:creator>anhht-hue</dc:creator><description>&lt;p&gt;Hi Chris,&amp;nbsp;&lt;br /&gt;Pls help me to how can I create CAD Document Item with file is attached to native File. (I using Aras 11.0 SP15)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks so much.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Create CAD Document using IOM API</title><link>https://www.aras.com/community/thread/3762?ContentTypeID=1</link><pubDate>Wed, 16 Oct 2019 13:50:43 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:c5d50448-b54e-4fbf-b629-d6f81007d8e3</guid><dc:creator>Christopher Gillis</dc:creator><description>&lt;p&gt;This is really a separate question to the one that was originally asked, so I&amp;#39;ll ask that you make a new forum post to ask it. Doing so helps maximize the visibility of your question to our entire community, and it also helps people find the answer if they have the same question in the future.&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;Chris&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Create CAD Document using IOM API</title><link>https://www.aras.com/community/thread/3759?ContentTypeID=1</link><pubDate>Wed, 16 Oct 2019 12:32:39 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:ebb8d981-e3ed-4cce-80f1-f889ae7adbac</guid><dc:creator>Former Member</dc:creator><description>&lt;p&gt;Thank Chris, after Iam using your example, i get error from server: &amp;quot;add access is denied for CAD&amp;quot;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What do you know about my problem?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank&amp;nbsp;&lt;span&gt;Chris!&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Create CAD Document using IOM API</title><link>https://www.aras.com/community/thread/926?ContentTypeID=1</link><pubDate>Sun, 15 Oct 2017 07:21:45 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:86eea38b-7b7e-41ba-b731-f82e52b10ce3</guid><dc:creator>Former Member</dc:creator><description>Thank you Chris, I think it should work.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Create CAD Document using IOM API</title><link>https://www.aras.com/community/thread/917?ContentTypeID=1</link><pubDate>Fri, 13 Oct 2017 09:43:07 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:51cdaebc-f45e-400f-af2e-db94704612a9</guid><dc:creator>Christopher Gillis</dc:creator><description>Hello,

It appears that the CADFiles relationship is unique in that it is not a relationship between the CAD and File itemtypes. Rather, it is a null relationship with a file property called &amp;quot;attached_file&amp;quot;.

I have updated the sample Method you provided to account for this. Additionally, I have updated your sample to use the newer &lt;em&gt;setFileProperty&lt;/em&gt; function that is in 11.0 SP9.

&lt;pre&gt;&lt;code&gt;// Create the CAd Document item

var docItem = MyInnovator.newItem(&amp;quot;CAD&amp;quot;, &amp;quot;add&amp;quot;);
docItem.setProperty(&amp;quot;item_number&amp;quot;, &amp;quot;CADDoc 004&amp;quot;);

// Create the relationship between the CAd Document and File
var relItem = MyInnovator.newItem(&amp;quot;CADFiles&amp;quot;, &amp;quot;add&amp;quot;);
relItem.setFileProperty(&amp;quot;attached_file&amp;quot;, @&amp;quot;C:\Temp\Test.txt&amp;quot;);

docItem.addRelationship(relItem);

var results = docItem.apply();&lt;/code&gt;&lt;/pre&gt;


If you are using a version of Innovator before 11.0 SP9, you will need to rewrite this sample to use the &lt;em&gt;attachPhysicalFile&lt;/em&gt; function that you were using initially.

Chris

______________________________________

Christopher Gillis

Aras Labs Software Engineer

&amp;nbsp;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>