Identifying the light source geometry

Identifying the light source geometry

Anonymous
Not applicable
722 Views
1 Reply
Message 1 of 2

Identifying the light source geometry

Anonymous
Not applicable

Hi all,

 

When I call get_geometry on a Lighting Fixture element, is there a way to check if the GeometryObject is the Light Source geometry? I am trying to identify it so I don't have to export it.

 

Thanks,

Mitch

0 Likes
Accepted solutions (1)
723 Views
1 Reply
Reply (1)
Message 2 of 2

jeremytammik
Autodesk
Autodesk
Accepted solution

Yes, there is.

 

A sample light fixture geometry includes five solids. One of them is empty, two others represent the light fixture geometry, and the last two represent the light source.

 

You can differentiate between them by checking the solid's GraphicsStyleId property:

 

https://www.revitapidocs.com/2020/4103f148-957e-3f44-9ccd-a5ed6702c689.htm

 

Here are the details of snooping the element and its geometry:

 

Id=566552; Class=FamilyInstance; Category=Lighting Fixtures; Name=120V; UniqueId=bc43ed2e-7e23-4f0e-9588-ab3c43f3d388-0008a518

Manage > Select by ID
RevitLookup > Snoop current selection
Geometry > View = null > Coarse
GetInstanceGeometry --> five solids

1. solid: zero volume, empty
2. solid: GraphicsStyleId null, volume 0.101...
3. solid: GraphicsStyleId null, volume 0.0189...
4. solid: GraphicsStyleId Light Source 88699, volume 8.97...
5. solid: GraphicsStyleId Light Source 88699, volume 8.97...

 

Here are some snapshots illustrating the snooping process and the results obtained:

 

Snooping with RevitLookupSnooping with RevitLookup

  

Coarse view nullCoarse view null

   

Light sourceLight source

   

Cheers,

 

Jeremy

 



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