<?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: Add Multiple URLs to element in Navisworks API Forum</title>
    <link>https://forums.autodesk.com/t5/navisworks-api-forum/add-multiple-urls-to-element/m-p/7814268#M4004</link>
    <description>&lt;P&gt;Yes, it looks like I am using the override. I am not sure what else to be using.&amp;nbsp;Below is the method I am using. It is taken from the examples found elsewhere, as you can. The SetOverrideURL code is identical since I found it on the other pages. Don't know what to use instead. The coordinate related commands are not necessary now, but I left everything intact. Thanks for the help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;private void AddURL(String URLstring, String URLtype, int i)&lt;BR /&gt;{&lt;BR /&gt;ComApi.InwOpState10 state;&lt;BR /&gt;state = ComApiBridge.ComApiBridge.State;&lt;/P&gt;&lt;P&gt;ComApi.InwURLOverride oMyURLOoverride = (ComApi.InwURLOverride)state.ObjectFactory(Autodesk.Navisworks.Api.Interop.ComApi.nwEObjectType.eObjectType_nwURLOverride, null, null);&lt;/P&gt;&lt;P&gt;double[] coordinate = { 10, 10, 0, 20, 20, 0, 30, 30, 0 };&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ComApi.InwURL2 oMyURL = (ComApi.InwURL2)state.ObjectFactory(Autodesk.Navisworks.Api.Interop.ComApi.nwEObjectType.eObjectType_nwURL, null, null);&lt;BR /&gt;oMyURL.name = URLtype;&lt;BR /&gt;oMyURL.URL = URLstring;&lt;/P&gt;&lt;P&gt;oMyURL.SetCategory("Hyperlink", "LcOaURLCategoryHyperlink");&lt;/P&gt;&lt;P&gt;ComApi.InwLPos3f oNewP = (ComApi.InwLPos3f)state.ObjectFactory(Autodesk.Navisworks.Api.Interop.ComApi.nwEObjectType.eObjectType_nwLPos3f, null, null);&lt;/P&gt;&lt;P&gt;oNewP.data1 = coordinate[i];&lt;BR /&gt;oNewP.data2 = coordinate[i + 1];&lt;BR /&gt;oNewP.data3 = coordinate[i + 2];&lt;/P&gt;&lt;P&gt;//oMyURL.AttachmentPoints().Add(oNewP);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ComApi.InwURLColl oURLColl = oMyURLOoverride.URLs();&lt;BR /&gt;oURLColl.Add(oMyURL);&lt;/P&gt;&lt;P&gt;ModelItemCollection modelItemCollectionIn = new ModelItemCollection(Autodesk.Navisworks.Api.Application.ActiveDocument.CurrentSelection.SelectedItems);&lt;/P&gt;&lt;P&gt;//convert to InwOpSelection of COM API&lt;BR /&gt;ComApi.InwOpSelection comSelectionOut =&lt;BR /&gt;ComApiBridge.ComApiBridge.ToInwOpSelection(modelItemCollectionIn);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;state.SetOverrideURL(comSelectionOut, oMyURLOoverride);&lt;BR /&gt;state.URLsEnabled = false;&lt;/P&gt;&lt;P&gt;return;&lt;BR /&gt;}&lt;/P&gt;</description>
    <pubDate>Wed, 28 Feb 2018 00:36:32 GMT</pubDate>
    <dc:creator>JasonKunkel</dc:creator>
    <dc:date>2018-02-28T00:36:32Z</dc:date>
    <item>
      <title>Add Multiple URLs to element</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/add-multiple-urls-to-element/m-p/7786919#M4001</link>
      <description>&lt;P&gt;I've read through what I think are all the pertinent posts, and they all point to this blog:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://adndevblog.typepad.com/aec/2012/05/create-hyperlinks-for-model-objects-using-net-api.html" target="_blank"&gt;http://adndevblog.typepad.com/aec/2012/05/create-hyperlinks-for-model-objects-using-net-api.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which was a great start point, but I am trying to add multiple hyperlinks to the same element. This code, and my failed attempts at updating it, simply overwrite the previous hyperlink.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Someone in the comments of the blog said they figured it out but never shared the solution. Anyone have a fix or tweak to the blog's code they can share that can point me in the right direction?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's more details:&lt;/P&gt;&lt;P&gt;I am using Data Tools to read in an Excel file. That file links via GUID to elements in my Navisworks model. That Excel file has 3 different URLs. My code reads those data properties and sends each one to the AddURL function (modified from the blog post above).&amp;nbsp; But each time, only the last URL ends up being added as a link. It is clearly overwriting the prior hyperlink. I've tried a lot of different things here (my COM knowledge is poor, and frankly, my .NET knowledge isn't awesome) and was hoping someone could help me out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2018 15:48:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/add-multiple-urls-to-element/m-p/7786919#M4001</guid>
      <dc:creator>JasonKunkel</dc:creator>
      <dc:date>2018-02-18T15:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: Add Multiple URLs to element</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/add-multiple-urls-to-element/m-p/7806720#M4002</link>
      <description>&lt;P&gt;Hi Jason,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I suppose you are using the override method, which in return fails to deliver what you are looking for.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ComApi.&lt;/SPAN&gt;&lt;SPAN&gt;InwURLOverride&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;oMyURLOoverride =&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (ComApi.&lt;/SPAN&gt;&lt;SPAN&gt;InwURLOverride&lt;/SPAN&gt;&lt;SPAN&gt;)state.ObjectFactory(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ComApi.&lt;/SPAN&gt;&lt;SPAN&gt;nwEObjectType&lt;/SPAN&gt;&lt;SPAN&gt;.eObjectType_nwURLOverride,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;null&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;null&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I might be able to help if I see your full code.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Feb 2018 10:21:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/add-multiple-urls-to-element/m-p/7806720#M4002</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-25T10:21:14Z</dc:date>
    </item>
    <item>
      <title>Re: Add Multiple URLs to element</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/add-multiple-urls-to-element/m-p/7811231#M4003</link>
      <description>&lt;P&gt;Hi Jason&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is sample code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Autodesk.Navisworks.Api.Interop.ComApi.InwOpState10 state = Autodesk.Navisworks.Api.ComApi.ComApiBridge.State;&lt;BR /&gt;ModelItem modelItem = Autodesk.Navisworks.Api.Application.ActiveDocument.CurrentSelection.SelectedItems.First;&lt;BR /&gt;ModelItemCollection modelItemCollection = new ModelItemCollection();&lt;BR /&gt;modelItemCollection.Add(modelItem);&lt;BR /&gt;Autodesk.Navisworks.Api.Interop.ComApi.InwOpSelection opSelection = Autodesk.Navisworks.Api.ComApi.ComApiBridge.ToInwOpSelection(modelItemCollection);&lt;BR /&gt;if (modelItem.PropertyCategories.FindCategoryByName("LcOaExURLAttribute")==null)&lt;BR /&gt;{&lt;BR /&gt;Autodesk.Navisworks.Api.Interop.ComApi.InwURLOverride oMyURLOoverride =&lt;BR /&gt;(Autodesk.Navisworks.Api.Interop.ComApi.InwURLOverride)state.ObjectFactory&lt;BR /&gt;(Autodesk.Navisworks.Api.Interop.ComApi.nwEObjectType.eObjectType_nwURLOverride, null, null);&lt;BR /&gt;Autodesk.Navisworks.Api.Interop.ComApi.InwURL2 newURL = (Autodesk.Navisworks.Api.Interop.ComApi.InwURL2)state.ObjectFactory(Autodesk.Navisworks.Api.Interop.ComApi.nwEObjectType.eObjectType_nwURL, null, null);&lt;BR /&gt;newURL.name = "NewLink";&lt;BR /&gt;newURL.URL = "NewLinkURL";&lt;BR /&gt;newURL.SetCategory("Hyperlink", "LcOaURLCategoryHyperlink");&lt;BR /&gt;oMyURLOoverride.URLs().Add(newURL);&lt;BR /&gt;state.SetOverrideURL(opSelection, oMyURLOoverride);&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;Autodesk.Navisworks.Api.Interop.ComApi.InwOaPath3 oPath3 =&lt;BR /&gt;Autodesk.Navisworks.Api.ComApi.ComApiBridge.ToInwOaPath(modelItem) as&lt;BR /&gt;Autodesk.Navisworks.Api.Interop.ComApi.InwOaPath3;&lt;BR /&gt;Autodesk.Navisworks.Api.Interop.ComApi.InwURLOverride oURLOverride = state.GetOverrideURL(oPath3);&lt;BR /&gt;Autodesk.Navisworks.Api.Interop.ComApi.InwURL2 newURL =&lt;BR /&gt;(Autodesk.Navisworks.Api.Interop.ComApi.InwURL2)state.ObjectFactory&lt;BR /&gt;(Autodesk.Navisworks.Api.Interop.ComApi.nwEObjectType.eObjectType_nwURL, null, null);&lt;BR /&gt;newURL.name = "URLName";&lt;BR /&gt;newURL.URL = "URL";&lt;BR /&gt;newURL.SetCategory("Hyperlink", "LcOaURLCategoryHyperlink");&lt;BR /&gt;oURLOverride.URLs().Add(newURL);&lt;BR /&gt;state.SetOverrideURL(opSelection, oURLOverride);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you must be select modelitem&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2018 03:55:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/add-multiple-urls-to-element/m-p/7811231#M4003</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-27T03:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: Add Multiple URLs to element</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/add-multiple-urls-to-element/m-p/7814268#M4004</link>
      <description>&lt;P&gt;Yes, it looks like I am using the override. I am not sure what else to be using.&amp;nbsp;Below is the method I am using. It is taken from the examples found elsewhere, as you can. The SetOverrideURL code is identical since I found it on the other pages. Don't know what to use instead. The coordinate related commands are not necessary now, but I left everything intact. Thanks for the help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;private void AddURL(String URLstring, String URLtype, int i)&lt;BR /&gt;{&lt;BR /&gt;ComApi.InwOpState10 state;&lt;BR /&gt;state = ComApiBridge.ComApiBridge.State;&lt;/P&gt;&lt;P&gt;ComApi.InwURLOverride oMyURLOoverride = (ComApi.InwURLOverride)state.ObjectFactory(Autodesk.Navisworks.Api.Interop.ComApi.nwEObjectType.eObjectType_nwURLOverride, null, null);&lt;/P&gt;&lt;P&gt;double[] coordinate = { 10, 10, 0, 20, 20, 0, 30, 30, 0 };&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ComApi.InwURL2 oMyURL = (ComApi.InwURL2)state.ObjectFactory(Autodesk.Navisworks.Api.Interop.ComApi.nwEObjectType.eObjectType_nwURL, null, null);&lt;BR /&gt;oMyURL.name = URLtype;&lt;BR /&gt;oMyURL.URL = URLstring;&lt;/P&gt;&lt;P&gt;oMyURL.SetCategory("Hyperlink", "LcOaURLCategoryHyperlink");&lt;/P&gt;&lt;P&gt;ComApi.InwLPos3f oNewP = (ComApi.InwLPos3f)state.ObjectFactory(Autodesk.Navisworks.Api.Interop.ComApi.nwEObjectType.eObjectType_nwLPos3f, null, null);&lt;/P&gt;&lt;P&gt;oNewP.data1 = coordinate[i];&lt;BR /&gt;oNewP.data2 = coordinate[i + 1];&lt;BR /&gt;oNewP.data3 = coordinate[i + 2];&lt;/P&gt;&lt;P&gt;//oMyURL.AttachmentPoints().Add(oNewP);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ComApi.InwURLColl oURLColl = oMyURLOoverride.URLs();&lt;BR /&gt;oURLColl.Add(oMyURL);&lt;/P&gt;&lt;P&gt;ModelItemCollection modelItemCollectionIn = new ModelItemCollection(Autodesk.Navisworks.Api.Application.ActiveDocument.CurrentSelection.SelectedItems);&lt;/P&gt;&lt;P&gt;//convert to InwOpSelection of COM API&lt;BR /&gt;ComApi.InwOpSelection comSelectionOut =&lt;BR /&gt;ComApiBridge.ComApiBridge.ToInwOpSelection(modelItemCollectionIn);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;state.SetOverrideURL(comSelectionOut, oMyURLOoverride);&lt;BR /&gt;state.URLsEnabled = false;&lt;/P&gt;&lt;P&gt;return;&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2018 00:36:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/add-multiple-urls-to-element/m-p/7814268#M4004</guid>
      <dc:creator>JasonKunkel</dc:creator>
      <dc:date>2018-02-28T00:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: Add Multiple URLs to element</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/add-multiple-urls-to-element/m-p/7814463#M4005</link>
      <description>&lt;P&gt;This is the same code in the blog. I suppose you might be running into trouble in the part where you modified the code. Within an override method/addURL.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2018 02:56:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/add-multiple-urls-to-element/m-p/7814463#M4005</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-28T02:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: Add Multiple URLs to element</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/add-multiple-urls-to-element/m-p/7815672#M4006</link>
      <description>&lt;P&gt;Yup. This is the same as the blog. And on the blog it also mentions that the URL is getting overridden. I need to know how to avoid overwriting the URL and simply add links. Sorry if I wasn't clear. Also in the comments on the blog post, others said that they had the same problem and that they fixed it, but never explained how they fixed it. This is all i need. I need to know how to modify that code to allow for multiple links.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2018 12:46:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/add-multiple-urls-to-element/m-p/7815672#M4006</guid>
      <dc:creator>JasonKunkel</dc:creator>
      <dc:date>2018-02-28T12:46:05Z</dc:date>
    </item>
    <item>
      <title>Re: Add Multiple URLs to element</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/add-multiple-urls-to-element/m-p/7815876#M4007</link>
      <description>&lt;P&gt;Well, would like to see the full project, send me at bebolwin@gmail.com&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2018 13:39:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/add-multiple-urls-to-element/m-p/7815876#M4007</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-28T13:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: Add Multiple URLs to element</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/add-multiple-urls-to-element/m-p/8966936#M4008</link>
      <description>&lt;P&gt;Was any of you were able to solve this issue? I am in the same boat. Please help. Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2019 23:32:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/add-multiple-urls-to-element/m-p/8966936#M4008</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-14T23:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: Add Multiple URLs to element</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/add-multiple-urls-to-element/m-p/9095986#M4009</link>
      <description>&lt;P&gt;May help someone else, the issue for me was that I needed to call the GetOverrideURL function with the optional parameter like this:&lt;/P&gt;&lt;PRE&gt;state.GetOverrideURL(path, true)&lt;/PRE&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The post method:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;state.GetOverrideURL(path)&lt;/PRE&gt;&lt;P&gt;fails when the existing urls are from the design software (e.g. Revit) and only returns a result if the existing urls have been added in Navisworks (manually or by your script).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Oct 2019 05:07:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/add-multiple-urls-to-element/m-p/9095986#M4009</guid>
      <dc:creator>ngombault</dc:creator>
      <dc:date>2019-10-19T05:07:44Z</dc:date>
    </item>
  </channel>
</rss>

