<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Syncing Vault Properties in Vault Customization Forum</title>
    <link>https://forums.autodesk.com/t5/vault-customization-forum/syncing-vault-properties/m-p/10140131#M3692</link>
    <description>&lt;P&gt;I read through this thread with the example and this &lt;A href="https://forums.autodesk.com/t5/vault-customization/filestoreservice-copyfile-has-changed-in-vault-2021/m-p/9697932/thread-id/8775" target="_self"&gt;thread&lt;/A&gt;.&amp;nbsp;&amp;nbsp;I feel like I'm close but can't quite get this to adapt to my existing code.This is what I have:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;List&amp;lt;PropWriteReq&amp;gt; propWriteList = new List&amp;lt;PropWriteReq&amp;gt;();

                foreach (var property in matchedProperties)
                {
                    PropDefInfo[] propInfo = _connection.WebServiceManager.PropertyService.GetPropertyDefinitionInfosByEntityClassId("FILE", new long[] { property.Id });

                    PropWriteReq propWrite = new PropWriteReq()
                    {
                        CanCreate = true,
                        Moniker = (propInfo[0].EntClassCtntSrcPropCfgArray != null ? propInfo[0].EntClassCtntSrcPropCfgArray[0].CtntSrcPropDefArray[0].Moniker : null),
                        Val = properties[property.DisplayName.ToLower().Trim().Replace(" ", "")]
                    };

                    propWriteList.Add(propWrite);
                }

                PropWriteResults results;


                // Clone the binary file contents, perserving the updated property data.

                byte[] uploadTicket = _connection.WebServiceManager.FilestoreService.CopyFile(
                   downloadTicket.Bytes, System.IO.Path.GetExtension(file.Name), true, propWriteList.ToArray(), out results);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions on the way it's written and how to get it to adapt to the code example? The List is throwing me off on this one.&lt;/P&gt;</description>
    <pubDate>Mon, 08 Mar 2021 20:50:37 GMT</pubDate>
    <dc:creator>ThomasRambach</dc:creator>
    <dc:date>2021-03-08T20:50:37Z</dc:date>
    <item>
      <title>Syncing Vault Properties</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/syncing-vault-properties/m-p/9762768#M3684</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have created a tool that helps me with updating iParts and iAssmblies. (iParts and iAssmblies dont work good when used in combination with vault library folders. I can't change that.) The process involves Checking in, out and changing lyfe cycle state. the tool worked fine with vault/Inventor 2018. But now im updating the tool to use it with 2021 and i run into a problem. the code that i have for Syncing Vault Properties does not work anymore. The problem is that i copyed that part of the &lt;A href="https://justonesandzeros.typepad.com/Files/PropSync/PropertySync.cs" target="_blank" rel="noopener"&gt;code&lt;/A&gt; from the blog &lt;A href="https://justonesandzeros.typepad.com/blog/2015/08/syncing-vault-properties-for-property-equivalence.html" target="_blank" rel="noopener"&gt;justonesandzeros&lt;/A&gt; by &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/289439"&gt;@Redmond.D&lt;/a&gt;&amp;nbsp;(and have a hard time understanding how it works.) Now with the update the api seems to be changed and it breaks my tool. The problem is on this line:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;byte[] uploadTicket = svcmgr.FilestoreService.CopyFile(
                    downloadTicket.Bytes, allowSync, writeProps,
                    out writeResults
                    );&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and i get the following compiler error:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;"Error CS7036 There is no argument given that corresponds to the required formal parameter 'writeResults' of 'FilestoreServiceBase.CopyFile(byte[], string, bool, PropWriteRequests, out PropWriteResults)'"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found that im missing a string value (for 'extension'). and the writeProps changed from object type&amp;nbsp;PropWriteReq[] to 'PropWriteRequests'. But i dont know how to get the &lt;A href="https://justonesandzeros.typepad.com/Files/PropSync/PropertySync.cs" target="_blank" rel="noopener"&gt;code&lt;/A&gt; to work again. Can any one help me fixing the code?&lt;/P&gt;&lt;P&gt;(The complete code is a bit long for an post but &lt;A href="https://justonesandzeros.typepad.com/Files/PropSync/PropertySync.cs" target="_blank" rel="noopener"&gt;this is a direct link to the code&lt;/A&gt;)&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 06:24:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/syncing-vault-properties/m-p/9762768#M3684</guid>
      <dc:creator>JelteDeJong</dc:creator>
      <dc:date>2020-09-23T06:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: Syncing Vault Properties</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/syncing-vault-properties/m-p/9765099#M3685</link>
      <description>&lt;P&gt;Hi Jelte,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use it too and had to change it a bit. The WriteResults is just an empty object I sent in:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;PropWriteResults result;
string[] cloaked;
fileFull = syncer.SyncProperties(file, "Property Sync", true, out result, out cloaked, true);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Problem with DEX ATM is, DWG and DXF files loose their properties but new Files are synced after creation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 07:00:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/syncing-vault-properties/m-p/9765099#M3685</guid>
      <dc:creator>thomas.behrendY5FX4</dc:creator>
      <dc:date>2020-09-24T07:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: Syncing Vault Properties</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/syncing-vault-properties/m-p/9771592#M3686</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think you should add the extension (e.g "dwg") as a parameter either in the 2nd position or the 3rd position.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that helps!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Wangdu&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.coolorange.com" target="_blank" rel="noopener"&gt;coolorange&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 07:09:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/syncing-vault-properties/m-p/9771592#M3686</guid>
      <dc:creator>wangdu</dc:creator>
      <dc:date>2020-09-28T07:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: Syncing Vault Properties</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/syncing-vault-properties/m-p/9771627#M3687</link>
      <description>&lt;P&gt;I think he means to get the extension from the file like that:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;byte[] uploadTicket = WebServiceManager.FilestoreService.CopyFile(downloadTicket.Bytes, System.IO.Path.GetExtension(file.Name), allowSync, reqs, out writeResults);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here I get the extensions from the Filename und the PropertySync class.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 07:32:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/syncing-vault-properties/m-p/9771627#M3687</guid>
      <dc:creator>thomas.behrendY5FX4</dc:creator>
      <dc:date>2020-09-28T07:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: Syncing Vault Properties</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/syncing-vault-properties/m-p/9771637#M3688</link>
      <description>&lt;P&gt;Right. Thats what I meant.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The &lt;SPAN&gt;PropWriteRequests seems to have a Requests property which you can assign the array of PropWritwReq object. See this Powershell snippet below on how you can assign it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;$propWriteReqs = New-Object Autodesk.Connectivity.WebServices.PropWriteRequests
$propWriteReq = New-Object Autodesk.Connectivity.WebServices.PropWriteReq
$propWriteReq.CanCreate = $titlecp.CreateNew
$propWriteReq.Moniker = $titlecp.Moniker
$propWriteReq.Val = $titlecp.Val
$propWriteReqs.Requests = @($propWriteReq)&lt;/LI-CODE&gt;&lt;P&gt;Hope it helps!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Wangdu&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.coolorange.com" target="_blank" rel="noopener"&gt;coolOrange&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 07:43:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/syncing-vault-properties/m-p/9771637#M3688</guid>
      <dc:creator>wangdu</dc:creator>
      <dc:date>2020-09-28T07:43:16Z</dc:date>
    </item>
    <item>
      <title>Re: Syncing Vault Properties</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/syncing-vault-properties/m-p/9771920#M3689</link>
      <description>&lt;P&gt;Thanks for the responses. with your sugestions i changed my code. Now i dont get any compile errors any more. But i could not test it. Something else is going wrong and i have to figure that out first. (i dont get a licence) i will let you know if it worked or not later. This is what i have for now:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;vltobj.PropWriteReq[] writeProps = compProps.Select(
    p =&amp;gt; new vltobj.PropWriteReq()
    {
        Moniker = p.Moniker,
        CanCreate = p.CreateNew,
        Val = p.Val 
    }
    ).ToArray();
vltobj.PropWriteRequests propWriteReqs = new vltobj.PropWriteRequests();
propWriteReqs.Requests = writeProps;

byte[] uploadTicket = svcmgr.FilestoreService.CopyFile(
    downloadTicket.Bytes, System.IO.Path.GetExtension(file.Name),
    allowSync, propWriteReqs,
    out writeResults
    );&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:11:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/syncing-vault-properties/m-p/9771920#M3689</guid>
      <dc:creator>JelteDeJong</dc:creator>
      <dc:date>2020-09-28T11:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: Syncing Vault Properties</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/syncing-vault-properties/m-p/9773710#M3690</link>
      <description>&lt;P&gt;Also, a viable option, if you have time to wait, would be a job:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;JobParam paramFileVersionId = new JobParam() { 
								Name = "FileVersionId",
								Val = file.Id.ToString()
							};
							var job = Context.Application.Connection.WebServiceManager.JobService.AddJob("Autodesk.Vault.SyncProperties", "property sync job", new JobParam[] { paramFileVersionId }, 1);&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:22:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/syncing-vault-properties/m-p/9773710#M3690</guid>
      <dc:creator>thomas.behrendY5FX4</dc:creator>
      <dc:date>2020-09-29T07:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: Syncing Vault Properties</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/syncing-vault-properties/m-p/9801580#M3691</link>
      <description>&lt;P&gt;I was able to test the code now (better late then never) and it works. For any one else finding this post later. attached you will find the complete updated code. (it's c# code but i was not allowed to upload files with the extension *.cs therefore i renamed it to PropertySync&lt;STRONG&gt;.txt &lt;/STRONG&gt;If you want to use it rename it back to PropertySync.&lt;STRONG&gt;cs&lt;/STRONG&gt;)&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2020 06:52:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/syncing-vault-properties/m-p/9801580#M3691</guid>
      <dc:creator>JelteDeJong</dc:creator>
      <dc:date>2020-10-14T06:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: Syncing Vault Properties</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/syncing-vault-properties/m-p/10140131#M3692</link>
      <description>&lt;P&gt;I read through this thread with the example and this &lt;A href="https://forums.autodesk.com/t5/vault-customization/filestoreservice-copyfile-has-changed-in-vault-2021/m-p/9697932/thread-id/8775" target="_self"&gt;thread&lt;/A&gt;.&amp;nbsp;&amp;nbsp;I feel like I'm close but can't quite get this to adapt to my existing code.This is what I have:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;List&amp;lt;PropWriteReq&amp;gt; propWriteList = new List&amp;lt;PropWriteReq&amp;gt;();

                foreach (var property in matchedProperties)
                {
                    PropDefInfo[] propInfo = _connection.WebServiceManager.PropertyService.GetPropertyDefinitionInfosByEntityClassId("FILE", new long[] { property.Id });

                    PropWriteReq propWrite = new PropWriteReq()
                    {
                        CanCreate = true,
                        Moniker = (propInfo[0].EntClassCtntSrcPropCfgArray != null ? propInfo[0].EntClassCtntSrcPropCfgArray[0].CtntSrcPropDefArray[0].Moniker : null),
                        Val = properties[property.DisplayName.ToLower().Trim().Replace(" ", "")]
                    };

                    propWriteList.Add(propWrite);
                }

                PropWriteResults results;


                // Clone the binary file contents, perserving the updated property data.

                byte[] uploadTicket = _connection.WebServiceManager.FilestoreService.CopyFile(
                   downloadTicket.Bytes, System.IO.Path.GetExtension(file.Name), true, propWriteList.ToArray(), out results);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions on the way it's written and how to get it to adapt to the code example? The List is throwing me off on this one.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 20:50:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/syncing-vault-properties/m-p/10140131#M3692</guid>
      <dc:creator>ThomasRambach</dc:creator>
      <dc:date>2021-03-08T20:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: Syncing Vault Properties</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/syncing-vault-properties/m-p/10141318#M3693</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of passing the array of PropWriteReq directly, you should pass an instance of PropWriteRequests and assign the list to the Requests property of the PropWriteRequests object. Something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var propWriteList = new List&amp;lt;PropWriteReq&amp;gt;();
var propWriteRequests = new PropWriteRequests();
//your foreach loop goes here
//
propWriteRequests.Request = propWriteList;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;hope it helps!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Wangdu&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.coolorange.com" target="_blank" rel="noopener"&gt;coolOrange&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 08:30:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/syncing-vault-properties/m-p/10141318#M3693</guid>
      <dc:creator>ITIT1402</dc:creator>
      <dc:date>2021-03-09T08:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: Syncing Vault Properties</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/syncing-vault-properties/m-p/10297613#M3694</link>
      <description>&lt;P&gt;be careful that&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;propInfo[0].EntClassCtntSrcPropCfgArray[0].CtntSrcPropDefArray&lt;/PRE&gt;&lt;P&gt;it's an array with all mappings of your props (duplicated, don't know why)&lt;/P&gt;&lt;P&gt;so you cannot take the first one but have to cycle on defs looking for the rigth one (ie type=file, idcnt 1=autocad, 4=inventor and so on): that way you don't add the wrong one to the wrong file type&lt;/P&gt;&lt;P&gt;again, defs are duplicated so pay attention to add only one when founded&lt;/P&gt;&lt;P&gt;than, look always for the result par of copyfile to see any errors&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 12:31:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/syncing-vault-properties/m-p/10297613#M3694</guid>
      <dc:creator>jacopo_chiappetti</dc:creator>
      <dc:date>2021-05-07T12:31:59Z</dc:date>
    </item>
  </channel>
</rss>

