How to get the relationship between FamilyInstance of light fixture and LightNod

How to get the relationship between FamilyInstance of light fixture and LightNod

Anonymous
Not applicable
535 Views
2 Replies
Message 1 of 3

How to get the relationship between FamilyInstance of light fixture and LightNod

Anonymous
Not applicable

Is there some relationship between FamilyInstance of light fixture and LightNod, and how to get it?

With below codes I can get LightingFixture object, but I can't advance to get the relationship between FamilyInstance of light fixture and LightNod.

 

            Element element = m_doc.GetElement(elementId);

            string element_category = element.Category.Name;

            if (element_category == "Lighting Fixtures")

            {

                FamilyInstance light = element as FamilyInstance;

                LightingFixture lightFxiture = light.MEPModel as LightingFixture;

            }

 

Can anyone give some help?

 

Thanks in advance.

0 Likes
536 Views
2 Replies
Replies (2)
Message 2 of 3

jeremytammik
Autodesk
Autodesk

There is no such thing as a LightNod in the Revit API.

 

Please be careful with spell checking, especially in the title of a thread.  

 

The LightNode class is generated by the custom exporter functionality:

 

https://www.revitapidocs.com/2020/3904e399-f67a-a111-d963-5f91665b233c.htm

 

If you implement a custom exporter, it will generate the LightNode class for you and the association with the family instance will be obvious:

 

https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.1

 



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

0 Likes
Message 3 of 3

Anonymous
Not applicable

Hi Jeremy,

 

Thank you very much for your help.

I made a typo in this question. LightNod should be LightNode.

 

I've read the pages you supplied to me about light, and I still don't know the association between family instance of light fixture and LightNode.

Can I get LightNode object from family instance of light fixture or can I get family instance of light fixture from LightNode object?

If not, how can I get LightNode object from family instance of light fixture?

 

Thanks again.

0 Likes