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.
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?
Have you worked through the getting started material?
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:
I hope this helps.
components of a truss:
List<ElementId> _members = _truss.Members.ToList<ElementId>();
in general for User Created Families:
List<ElementId> _members =_instance.GetSubComponentIds().ToList<ElementId>();
Thanks to Fair59 for the nice succinct answer. Promoted to a blog post:
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
Search the Autodesk Knowledge Network for more content.
New: Get an Activation Code
Mac OS X 10.12 Support
Windows 10 Support
Autodesk Online Store Help
Serial Numbers & Product Keys
Installation & Licensing
Online Activation & Registration
Network License Administration
Created by the community for the community, Autodesk Exchange Apps for Revit helps you achieve greater speed, accuracy, and automation from concept to manufacturing.