I would like to get the components of a struss, using the API, I tried using the property of GroupId, but it doesn't work. And in general the components of a family. Any help is welcome. Thanks.
Dear Javier,
I am not aware of the internal structure of a truss, so I cannot help you with that without deeper exploration or further information.
However, if this is a specialisation of your more general query on how to access the internal components of a family instance, which I assume it is, then I can help you after all.
First a couple of question to you:
Are you pretty new to the Revit developer community?
Have you installed RevitLookup?
https://github.com/jeremytammik/RevitLookup
Have you worked through the getting started material?
http://thebuildingcoder.typepad.com/blog/about-the-author.html#2
Have you looked at some of the discussions on how to research a Revit API task or problem?
Have you any experience with the Revit user interface?
That helps a lot to understand the programming side of things!
If you can answer yes to all of those question, let's continue.
If you answered no to any one of them, please complete that learning step before reading on. Thank you!
Now to address your question:
Have you explored how you can access the subelements of your truss through the user interface?
I would assume that you would do so by selecting a truss family instance and clicking the button saying 'Edit Family'.
The approach through the API is exactly equivalent:
http://www.revitapidocs.com/2017/56e636ee-5008-0ee5-9d6c-5f622dedfbcb.htm
I hope this helps.
Cheers,
Jeremy
components of a truss:
Autodesk.Revit.DB.Structure.Truss _truss;
List<ElementId> _members = _truss.Members.ToList<ElementId>();
in general for User Created Families:
FamilyInstance _instance;
List<ElementId> _members =_instance.GetSubComponentIds().ToList<ElementId>();
Thanks to Fair59 for the nice succinct answer. Promoted to a blog post:
http://thebuildingcoder.typepad.com/blog/2017/02/revitserverapilib-truss-members-and-layers.html#4
Cheers,
Jeremy
Hi,
Yes I am new in the use of Revit interface, I start a new job in a company where I am developing an app in c#. About if I have installed RevitLookup, no I do not, in fact I can't understand what it does.
The started material that I used it was the Revit API Developers Guide from Autodesk webpage.
And finally I don't looked at how research REVIT API
Cheer and thank for your help
Javi
Can't find what you're looking for? Ask the community or share your knowledge.