<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Copy and Place Light Fixtures in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/copy-and-place-light-fixtures/m-p/10290165#M26247</link>
    <description>&lt;P&gt;Still no luck using NewFamilyInstance to copy a light fixture and having the copy hosted to a level or a reference plane.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I did manage to copy a light to a specific location using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;doc.Create.NewFamilyInstance(XYZ point, lightFamilySymbol, Autodesk.Revit.DB.Structure.StructuralType.NonStructural)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I also found I could get the result I wanted by using the ElementTransformUtils.CopyElements(doc, selectedIds, point).&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;That will copy a light hosted to either a level or a reference plane, and will make the copy hosted to the same level or reference plane.&amp;nbsp; That's exactly what I was trying to do.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 04 May 2021 16:51:42 GMT</pubDate>
    <dc:creator>sragan</dc:creator>
    <dc:date>2021-05-04T16:51:42Z</dc:date>
    <item>
      <title>Copy and Place Light Fixtures</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/copy-and-place-light-fixtures/m-p/10279993#M26241</link>
      <description>&lt;P&gt;I have a macro that places copies of a light fixture on a lighting plan.&amp;nbsp; It works great if the light to be copied is a face based light that is placed on a ceiling grid using the "Place on Face" option.&amp;nbsp; The copies are placed on the same ceiling grid.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, it doesn't work if the original light fixture is placed on a level using the "Place on Work Plane" option.&amp;nbsp; &amp;nbsp;I know I need to use a different overload for placing these lights, but I have tried multiple times, and I can't figure out how to get this to work.&amp;nbsp; Can anyone help?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the lights placed on a ceiling grid, I use this to get the host face:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Reference hostFace = lightFamilyInstance.HostFace;&lt;/LI-CODE&gt;&lt;P&gt;Then to place the lights I use this overload:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;FamilyInstance lightFamilyInstance2 = doc.Create.NewFamilyInstance(hostFace, pointtoplace, rotation,lightFamilySymbol );&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I modify these two lines to make then work for a light fixture placed on a level?&amp;nbsp; I know from stepping through the code that for the lights placed on a level, hostFace remains null.&amp;nbsp; I've tried changing that line to&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Element host = lightFamilyInstance.Host;&lt;/LI-CODE&gt;&lt;P&gt;but I can't find any way to insert a light using the host, and I can't figure out how to get a hostFace from that element.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 22:21:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/copy-and-place-light-fixtures/m-p/10279993#M26241</guid>
      <dc:creator>sragan</dc:creator>
      <dc:date>2021-04-29T22:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: Copy and Place Light Fixtures</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/copy-and-place-light-fixtures/m-p/10280408#M26242</link>
      <description>&lt;P&gt;You can get the Reference of the plane.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;ReferencePlane plane1 = **get plane;
FamilyInstance fi = Doc.Create.NewFamilyInstance(plane1.Reference, XYZ.Zero, refDir, fs);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/td-p/4962340" target="_blank"&gt;https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/td-p/4962340&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Apr 2021 03:00:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/copy-and-place-light-fixtures/m-p/10280408#M26242</guid>
      <dc:creator>Sean_Page</dc:creator>
      <dc:date>2021-04-30T03:00:55Z</dc:date>
    </item>
    <item>
      <title>Re: Copy and Place Light Fixtures</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/copy-and-place-light-fixtures/m-p/10281413#M26243</link>
      <description>&lt;P&gt;I assume “** get plane” is shorthand for whatever code I am using to get the reference plane?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That seems to be the part I’m having trouble with. &amp;nbsp;The light to be copied is placed on a level, not a reference plane. &amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I think I’ve finally found a way to get this level using get built up in parameter, but any attempt to cast the level to a reference plane fails.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Apr 2021 12:22:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/copy-and-place-light-fixtures/m-p/10281413#M26243</guid>
      <dc:creator>stever66</dc:creator>
      <dc:date>2021-04-30T12:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: Copy and Place Light Fixtures</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/copy-and-place-light-fixtures/m-p/10281472#M26244</link>
      <description>&lt;P&gt;If the "host" isn't a plane or a face, then why not use one of the other overloads for placing family instances?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Inserts a new instance of a family into the document, using a location, type/symbol and a base level.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.revitapidocs.com/2017/9cdda5d9-85f7-4445-1e84-5fda77d41f74.htm" target="_blank" rel="noopener"&gt;NewFamilyInstance Method (XYZ, FamilySymbol, Level, StructuralType)&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Inserts a new instance of a family into the document, using a location, type/symbol, the host element and a base level.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A title="NewFamilyInstance Method (XYZ, FamilySymbol, Element, Level, StructuralType)" href="https://www.revitapidocs.com/2017/168d4c67-73dd-d7c8-4969-12846eeaddfa.htm" target="_blank" rel="noopener"&gt;NewFamilyInstance Method (XYZ, FamilySymbol, Element, Level, StructuralType)&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Apr 2021 12:42:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/copy-and-place-light-fixtures/m-p/10281472#M26244</guid>
      <dc:creator>Sean_Page</dc:creator>
      <dc:date>2021-04-30T12:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: Copy and Place Light Fixtures</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/copy-and-place-light-fixtures/m-p/10281564#M26245</link>
      <description>&lt;P&gt;I have tried.&amp;nbsp; In fact, I've spent hours trying every combination under the sun.&amp;nbsp; Nothing I've tired works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I realize there are actually 3 different situations;&amp;nbsp; &amp;nbsp;A light fixture hosted to a face (a ceiling grid, for example), a light fixture hosted to a level, or a light fixture hosted to a reference plane.&amp;nbsp; See the attached image for examples.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As I've mentioned, I've got the first case working using some example code I found, but the last two cases completely escape me.&amp;nbsp; &amp;nbsp;I'm sure other people would also be interested in seeing a example of how to do this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using Revit 2021, by the way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Apr 2021 13:14:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/copy-and-place-light-fixtures/m-p/10281564#M26245</guid>
      <dc:creator>sragan</dc:creator>
      <dc:date>2021-04-30T13:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: Copy and Place Light Fixtures</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/copy-and-place-light-fixtures/m-p/10287066#M26246</link>
      <description>&lt;P&gt;For what we do I don't care much for the host of the family, we just need it to be the right location in 3d. (not having a way to copy monitor ceilings has driven this problem too)&amp;nbsp; For that I grab the origin point, then place a family on the current level with it's origin at the same point.&amp;nbsp; None of our light fixtures are surface based.&amp;nbsp; Through some fun trickery you can also get the rotation and get them to align as well.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 13:43:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/copy-and-place-light-fixtures/m-p/10287066#M26246</guid>
      <dc:creator>timlove</dc:creator>
      <dc:date>2021-05-03T13:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: Copy and Place Light Fixtures</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/copy-and-place-light-fixtures/m-p/10290165#M26247</link>
      <description>&lt;P&gt;Still no luck using NewFamilyInstance to copy a light fixture and having the copy hosted to a level or a reference plane.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I did manage to copy a light to a specific location using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;doc.Create.NewFamilyInstance(XYZ point, lightFamilySymbol, Autodesk.Revit.DB.Structure.StructuralType.NonStructural)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I also found I could get the result I wanted by using the ElementTransformUtils.CopyElements(doc, selectedIds, point).&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;That will copy a light hosted to either a level or a reference plane, and will make the copy hosted to the same level or reference plane.&amp;nbsp; That's exactly what I was trying to do.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 May 2021 16:51:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/copy-and-place-light-fixtures/m-p/10290165#M26247</guid>
      <dc:creator>sragan</dc:creator>
      <dc:date>2021-05-04T16:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: Copy and Place Light Fixtures</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/copy-and-place-light-fixtures/m-p/10296130#M26248</link>
      <description>&lt;P&gt;Apparently the "PointToPlace" parameter works different for the NewFamilyInstance then it does for the CopyElement routine.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;No big deal, for the CopyElement case I just need to subtract the Elements LocationPoint from the point I want the lights.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I can't get the elevation to work right for all cases.&amp;nbsp; &amp;nbsp;It works fine for the NewFamilyInstance method.&amp;nbsp; But for a&amp;nbsp; level based light and the CopyElement method, I have to also subtract the "BuiltInParameter.FLOOR_HEIGHTABOVELEVEL_PARAM" from the point I want the lights,&amp;nbsp; or my copied lights wind up at twice the height as the original.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;But even that doesn't work for lights hosted to a reference plane.&amp;nbsp; &amp;nbsp;I can't seem to figure out how to keep them from winding up at twice the height as their original.&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2021 20:24:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/copy-and-place-light-fixtures/m-p/10296130#M26248</guid>
      <dc:creator>sragan</dc:creator>
      <dc:date>2021-05-06T20:24:22Z</dc:date>
    </item>
  </channel>
</rss>

