Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Component of a truss

5 REPLIES 5
Reply
Message 1 of 6
javierdopazo
421 Views, 5 Replies

Component of a truss

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.

5 REPLIES 5
Message 2 of 6
jeremytammik
in reply to: javierdopazo

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?

 

http://thebuildingcoder.typepad.com/blog/2017/01/virtues-of-reproduction-research-mep-settings-ontol...

 

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

 

 

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 6
FAIR59
in reply to: javierdopazo

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>();

Message 4 of 6
jeremytammik
in reply to: FAIR59

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



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 5 of 6
javierdopazo
in reply to: FAIR59

Thanks for the answer It work on very well

Message 6 of 6
javierdopazo
in reply to: jeremytammik

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.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community