AssemblyInstance Create permitted for membership

AssemblyInstance Create permitted for membership

dorer69044
Contributor Contributor
438 Views
1 Reply
Message 1 of 2

AssemblyInstance Create permitted for membership

dorer69044
Contributor
Contributor

Hi all, 

I'm trying to create an Assembly using the following method:

public static AssemblyInstance Create(Document document, ICollection<ElementId> assemblyMemberIds, ElementId namingCategoryId)


And I got the following error message:
Autodesk.Revit.Exceptions.ArgumentException: 'One or more element ids was not permitted for membership in the assembly instance. Elements should be of a valid category and should not be a member of an existing assembly.
Parameter name: assemblyMemberIds'

Is there any way to find from the list of elements that are not allowed to be added to the assembly?
For example, I have 3 elements and I want to find out which of them cannot be added to the assembly.

Thanks 🙂

439 Views
1 Reply
Reply (1)
Message 2 of 2

moturi.magati.george
Autodesk
Autodesk

Hi @dorer69044,

You could try to use AreElementsValidForAssembly Method to get the same:
https://www.revitapidocs.com/2023/b86d920d-dd9e-db71-c650-cdfbf623942d.htm


  Moturi George,     Developer Advocacy and Support,  ADN Open
0 Likes