Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.

Revit API Forum

Reply
Post 1 of 6

Component of a truss

115 Views, 5 Replies
01-31-2017 04:57 AM

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.

Post 2 of 6

Re: Component of a truss

01-31-2017 07:19 AM 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

Highlighted
Post 3 of 6

Re: Component of a truss

02-01-2017 04:42 AM 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>();

Post 4 of 6

Re: Component of a truss

02-02-2017 02:27 AM 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

Post 5 of 6

Re: Component of a truss

02-16-2017 01:41 AM in reply to: FAIR59

Thanks for the answer It work on very well

Post 6 of 6

Re: Component of a truss

02-16-2017 01:51 AM 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

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post

Revit Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Revit helps you achieve greater speed, accuracy, and automation from concept to manufacturing.