<?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: Cannot Get Bindingmap of a family Document Error 2014 in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/cannot-get-bindingmap-of-a-family-document-error-2014/m-p/4911746#M79175</link>
    <description>&lt;P&gt;By the way, this issue came up again, so I promoted it to a blog post on The Building Coder:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2014/03/cannot-get-bindingmap-of-a-family-document.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2014/03/cannot-get-bindingmap-of-a-family-document.html&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Mar 2014 14:21:28 GMT</pubDate>
    <dc:creator>jeremytammik</dc:creator>
    <dc:date>2014-03-26T14:21:28Z</dc:date>
    <item>
      <title>Cannot Get Bindingmap of a family Document Error 2014</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/cannot-get-bindingmap-of-a-family-document-error-2014/m-p/4317835#M79172</link>
      <description>&lt;P&gt;I have an addin that, amongst other things, adds and sets a custom ID parameter to family files.&lt;/P&gt;&lt;P&gt;This has been working fine in 2012 and 2013 but now I'm trying it in 2014 I'm getting the above error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;            Dim bin As Autodesk.Revit.DB.Binding = m_app.Create.NewTypeBinding(catSet)            
            If Not m_doc.ParameterBindings.Insert(def, bin) Then ' ERROR HERE&lt;/PRE&gt;&lt;P&gt;m_doc is my family document&lt;/P&gt;&lt;P&gt;def is my parameter definition&lt;/P&gt;&lt;P&gt;catSet is a category set containing the category that I'm trying to add the parameter to.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll admit that I'm no Revit API expert so I may be going about this the wrong way but as I've said, it seems to work OK for 2012 and 2013. Is there something else I need to do for 2014?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2013 08:12:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/cannot-get-bindingmap-of-a-family-document-error-2014/m-p/4317835#M79172</guid>
      <dc:creator>Paulio</dc:creator>
      <dc:date>2013-07-03T08:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot Get Bindingmap of a family Document Error 2014</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/cannot-get-bindingmap-of-a-family-document-error-2014/m-p/4330483#M79173</link>
      <description>&lt;P&gt;Dear Paul,&lt;BR /&gt;&lt;BR /&gt;Thank you for your query.&lt;BR /&gt;&lt;BR /&gt;I implemented the attached sample application and can reproduce the issue you describe.&lt;BR /&gt;&lt;BR /&gt;In a newly created empty family document based on the Generic Model template, it reports the following:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;Info: Inside CreateIDParameter function. Cat is: Walls&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;Info: Opened Shared Parameters file&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;Info: sharedFile is Autodesk.Revit.DB.DefinitionFile&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;Info: Got Group&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;Info: Got CADSID def&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;A first chance exception of type 'Autodesk.Revit.Exceptions.InvalidOperationException' occurred in RevitAPI.dll&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;Cannot get the BindingMap of a family document.&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;Here is the complete source code:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp; Public Function CreateIDParameter( _&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ByVal doc As Document,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ByVal cat As Category) As Boolean&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.WriteLine(String.Format("Info: Inside CreateIDParameter function. Cat is: {0}", IIf(cat Is Nothing, "NOTHING", cat.Name)))&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim app As Application = doc.Application&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim sharedFile As DefinitionFile&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sharedFile = app.OpenSharedParameterFile()&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.WriteLine("Info: Opened Shared Parameters file")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Catch ex As Exception&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return False&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Try&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.WriteLine(String.Format("Info: sharedFile is {0}", IIf(sharedFile Is Nothing, "NOTHING", sharedFile)))&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim grp As DefinitionGroup = sharedFile.Groups.Item("IDENTIFIER")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If grp Is Nothing Then&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; grp = sharedFile.Groups.Create("IDENTIFIER")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.WriteLine("Info: Created group IDENTIFIER")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.WriteLine("Info: Got Group")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If grp Is Nothing Then Return False&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim def As Definition = grp.Definitions.Item("CADSID")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If def Is Nothing Then&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; def = grp.Definitions.Create("CADSID", ParameterType.Text, False)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.WriteLine("Info: Created CADSID def")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.WriteLine("Info: Got CADSID def")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If def Is Nothing Then Return False&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim catSet As CategorySet = app.Create.NewCategorySet()&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; catSet.Insert(cat)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim bin As Binding = Nothing&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim bindings As BindingMap&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim res As Boolean = Nothing&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bin = app.Create.NewTypeBinding(catSet)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bindings = doc.ParameterBindings&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; res = doc.ParameterBindings.Insert(def, bin) 'ERROR OCCURS HERE&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Catch ex As Exception&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.WriteLine(ex.Message)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return False&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Try&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return True&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp; End Function&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp; Public Function Execute(&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ByVal commandData As ExternalCommandData,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ByRef message As String,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ByVal elements As ElementSet) _&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp; As Result Implements IExternalCommand.Execute&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim uiapp As UIApplication = commandData.Application&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim uidoc As UIDocument = uiapp.ActiveUIDocument&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim app As Application = uiapp.Application&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim doc As Document = uidoc.Document&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim cat As Category = doc.Settings.Categories.Item(BuiltInCategory.OST_Walls)&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CreateIDParameter(doc, cat)&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return Result.Succeeded&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp; End Function&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;I also attached it together with the Visual Studio solution and add-in manifest to this message in _08576310.zip.&lt;BR /&gt;&lt;BR /&gt;I searched for other reports of this error and could not find any, so I do rather suspect that you are doing something unusual here.&lt;BR /&gt;&lt;BR /&gt;Are you sure that it makes sense to create a shared parameter for a family document?&lt;BR /&gt;&lt;BR /&gt;The error message looks to me as if the API is intentionally restricting you from doing what you do.&lt;BR /&gt;&lt;BR /&gt;A couple of other similar restrictions were introduced in Revit 2014 which broke other applications as well. They were all doing dirty deeds, and now that is prevented.&lt;BR /&gt;&lt;BR /&gt;You should probably discuss with a product usage expert what exactly you are trying to achieve, and see how you should implement that optimally manually before trying to automate it.&lt;BR /&gt;&lt;BR /&gt;It looks to me as if the workflow you were using in the past is not following Revit best practices.&lt;BR /&gt;&lt;BR /&gt;I hope this helps.&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2013 15:28:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/cannot-get-bindingmap-of-a-family-document-error-2014/m-p/4330483#M79173</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2013-07-15T15:28:50Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot Get Bindingmap of a family Document Error 2014</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/cannot-get-bindingmap-of-a-family-document-error-2014/m-p/4367779#M79174</link>
      <description>&lt;P&gt;Here is the summary of the resolution of the associated ADN case 08576310 [Error creating parameter in family]:&lt;BR /&gt;&lt;BR /&gt;Jeremy says: the possibility to add a shared parameter via the binding map was removed for families in Revit 2014.&lt;BR /&gt;&lt;BR /&gt;The reason for this is that you can use an overload of the FamilyManager.AddParameter method instead.&lt;BR /&gt;&lt;BR /&gt;The modification to your existing code should be simple.&lt;BR /&gt;&lt;BR /&gt;Paul replies: I have successfully resolved the issue now based upon your latest message.&lt;BR /&gt;&lt;BR /&gt;It turns out that I just needed to remove the part that tried to bind the parameter to the family document. I only needed to create the definition if it didn’t exist and then use that when adding the parameter to the family.&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2013 13:39:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/cannot-get-bindingmap-of-a-family-document-error-2014/m-p/4367779#M79174</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2013-08-15T13:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot Get Bindingmap of a family Document Error 2014</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/cannot-get-bindingmap-of-a-family-document-error-2014/m-p/4911746#M79175</link>
      <description>&lt;P&gt;By the way, this issue came up again, so I promoted it to a blog post on The Building Coder:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2014/03/cannot-get-bindingmap-of-a-family-document.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2014/03/cannot-get-bindingmap-of-a-family-document.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Mar 2014 14:21:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/cannot-get-bindingmap-of-a-family-document-error-2014/m-p/4911746#M79175</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2014-03-26T14:21:28Z</dc:date>
    </item>
  </channel>
</rss>

