<?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: family instance on reference plane with API in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6706810#M77090</link>
    <description>@tf did you use promptforfamilyinstanceplacement though? Once you have a family placed correctly, you can fairly easily swap it out for another one. Just get its info (you may need to regen first), delete it, and place a new one. Hoops to jump through, but it allows you to forget about most of the maths.@Anonymous did you use promptforfamilyinstanceplacement though? Once you have a family placed correctly, you can fairly easily swap it out for another one. Just get its info (you may need to regen first), delete it, and place a new one. Hoops to jump through, but it allows you to forget about most of the maths.&lt;BR /&gt;Otherwise, you need to get your transforms, normals, etc well thought out.</description>
    <pubDate>Wed, 23 Nov 2016 23:37:34 GMT</pubDate>
    <dc:creator>matthew_taylor</dc:creator>
    <dc:date>2016-11-23T23:37:34Z</dc:date>
    <item>
      <title>family instance on reference plane with API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/4962340#M77080</link>
      <description>&lt;P&gt;Trying to place a family instance of electrical fixture onto a reference plane with Revit 2013 API. &amp;nbsp;I get the following ArgumentsInconsistentException "Reference direction is parallel to face normal at insertion point.", "Parameter name: multiple". &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;using (Transaction trans = new Transaction(Doc, "TEST"))
{
    trans.Start();&lt;BR /&gt;
    XYZ bubbleEnd = new XYZ(5, 0, 0);
    XYZ freeEnd = new XYZ(-5, 0, 0);&lt;BR /&gt;    XYZ cutVec = new XYZ(0, 0, 1);&lt;BR /&gt;&lt;BR /&gt;    ReferencePlane plane1 = Doc.Create.NewReferencePlane(bubbleEnd, freeEnd,&lt;BR /&gt;                                         cutVec, Doc.activeView) //floor plan, top-down view&lt;BR /&gt;    &lt;BR /&gt;    XYZ refDir = new XYZ(0, 0, -1);  &lt;BR /&gt;
    FamilySymbol fs = new FilteredElementCollector(Doc)..yada..get duplex receptacle familysymbol&lt;BR /&gt;&lt;BR /&gt;    FamilyInstance fi = Doc.Create.NewFamilyInstance(plane1.Reference, XYZ.Zero, refDir, fs);&lt;BR /&gt;&lt;BR /&gt;    trans.Commit();
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The reference plane drawn is a vertical reference plane stretching length-wise along the world x-axis and height-wise along the world z-axis. &amp;nbsp;If I were to add a receptacle using the revit interface it would connect on the -y face of the reference plane...the underside of the plane if looking down on the floor plan. &amp;nbsp;I've tried every possible reference direction for the newfamilyinstance in the code. &amp;nbsp;I tried refDir as positive and negative for each X, Y, and Z axis...and not one reference direction worked. &amp;nbsp;I also made an exact replica command as Jeremy's post here...&amp;nbsp;&lt;A target="_self" href="http://thebuildingcoder.typepad.com/blog/2012/02/hosting-a-light-fitting-on-a-reference-plane.html"&gt;http://thebuildingcoder.typepad.com/blog/2012/02/hosting-a-light-fitting-on-a-reference-plane.html&lt;/A&gt;&amp;nbsp;and nothing worked here either. &amp;nbsp;Always the same above-mentioned exception. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Apr 2014 22:03:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/4962340#M77080</guid>
      <dc:creator>mononull</dc:creator>
      <dc:date>2014-04-15T22:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: family instance on reference plane with API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/4968906#M77081</link>
      <description>" If I were to add a receptacle using the revit interface it would connect on the -y face of the reference plane...the underside of the plane if looking down on the floor plan."&lt;BR /&gt;&lt;BR /&gt;*I meant to say positive y face...the receptacles are attached on the top side, the way they are drawn just appears the other way, but regardless, I still cannot get a reference direction to work.</description>
      <pubDate>Thu, 17 Apr 2014 18:57:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/4968906#M77081</guid>
      <dc:creator>mononull</dc:creator>
      <dc:date>2014-04-17T18:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: family instance on reference plane with API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6701464#M77082</link>
      <description>&lt;P&gt;I have the same exact issue. &amp;nbsp;&amp;nbsp;We have an App that places electrical outlets in a space and this works great 75% of the time. The issue we have is on some interior rooms it uses the correct face of the wall but the hosted device is 180 degrees off. So the device face is inside the wall and the back of the device is in the room. Using the snoop command on the device and on the host wall we can't see how to calculate the correct reference direction? Also when I use anything other than (0,0,0) for the reference direction it throws an error that the says reference direction is parallel to the host. I tried (0,1,0) (1,0,0) (0,0,1) all with the same results.&lt;BR /&gt;Any suggestions would be greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 01:07:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6701464#M77082</guid>
      <dc:creator>tf</dc:creator>
      <dc:date>2016-11-22T01:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: family instance on reference plane with API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6705704#M77083</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1775427"&gt;@mononull﻿&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have you tried refDir = (0, 0, 0) ? Could you share the family you are trying to place?&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 16:51:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6705704#M77083</guid>
      <dc:creator>BardiaJahan</dc:creator>
      <dc:date>2016-11-23T16:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: family instance on reference plane with API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6705963#M77084</link>
      <description>&lt;P&gt;Thanks for reply. &amp;nbsp;Yes I have used (0,0,0). &amp;nbsp;I am using the Revit "out of the box" US Imperial - Electrical - MEP - Electrical Power - Terminals - Duplex&lt;/P&gt;&lt;P&gt;As you can see from the Attached screen shot the results work fine for one of the devices and the other device is connected to the correct face but is flipped. &amp;nbsp;Using the snoop tool the direction, flipped, etc. look identical on both instances.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code is very simple:&lt;/P&gt;&lt;P&gt;Dim RefDir As XYZ = New XYZ(0, 0, 0)&lt;BR /&gt;Dim ref As Reference = HostObjectUtils.GetSideFaces(SegWall, ShellLayerType.Interior).First()&lt;BR /&gt;CreateHostedElecDevice = M_document.Create.NewFamilyInstance(ref, DevicePoint, RefDir, DeviceFamilySymbol)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Thanks again for any help!&lt;/P&gt;&lt;P&gt;AsReceptical. &amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 567px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/295719i57C062AD1FF0FFCE/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;﻿&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 18:20:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6705963#M77084</guid>
      <dc:creator>tf</dc:creator>
      <dc:date>2016-11-23T18:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: family instance on reference plane with API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6706324#M77085</link>
      <description>&lt;P&gt;Following is pretty much the same code as yours. I am trying it and it places the receptacle on the interior side of the walls at the middle. What are you using for DevicePoint?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Snippet&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;FilteredElementCollector&lt;/SPAN&gt;&amp;nbsp;collector&amp;nbsp;=&amp;nbsp;&lt;SPAN&gt;new&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;FilteredElementCollector&lt;/SPAN&gt;(document);
collector.OfClass(&lt;SPAN&gt;typeof&lt;/SPAN&gt;(&lt;SPAN&gt;FamilySymbol&lt;/SPAN&gt;)).OfCategory(&lt;SPAN&gt;BuiltInCategory&lt;/SPAN&gt;.OST_ElectricalFixtures);&lt;BR /&gt;symbol&amp;nbsp;=&amp;nbsp;collector.FirstElement()&amp;nbsp;&lt;SPAN&gt;as&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;FamilySymbol&lt;/SPAN&gt;;
 
&lt;SPAN&gt;FilteredElementCollector&lt;/SPAN&gt;&amp;nbsp;collector2&amp;nbsp;=&amp;nbsp;&lt;SPAN&gt;new&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;FilteredElementCollector&lt;/SPAN&gt;(document);
collector2.OfClass(&lt;SPAN&gt;typeof&lt;/SPAN&gt;(&lt;SPAN&gt;Wall&lt;/SPAN&gt;));
 
&lt;SPAN&gt;foreach&lt;/SPAN&gt;&amp;nbsp;(&lt;SPAN&gt;Element&lt;/SPAN&gt;&amp;nbsp;element&amp;nbsp;&lt;SPAN&gt;in&lt;/SPAN&gt;&amp;nbsp;collector2)
{
	&lt;SPAN&gt;Wall&lt;/SPAN&gt;&amp;nbsp;wall&amp;nbsp;=&amp;nbsp;element&amp;nbsp;&lt;SPAN&gt;as&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;Wall&lt;/SPAN&gt;;
	&lt;SPAN&gt;LocationCurve&lt;/SPAN&gt;&amp;nbsp;lc&amp;nbsp;=&amp;nbsp;wall.Location&amp;nbsp;&lt;SPAN&gt;as&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;LocationCurve&lt;/SPAN&gt;;
	&lt;SPAN&gt;XYZ&lt;/SPAN&gt;&amp;nbsp;mid&amp;nbsp;=&amp;nbsp;0.5&amp;nbsp;*&amp;nbsp;(lc.Curve.GetEndPoint(0)&amp;nbsp;+&amp;nbsp;lc.Curve.GetEndPoint(1));
	&lt;SPAN&gt;Reference&lt;/SPAN&gt;&amp;nbsp;reference&amp;nbsp;=&amp;nbsp;&lt;SPAN&gt;HostObjectUtils&lt;/SPAN&gt;.GetSideFaces(wall,&amp;nbsp;&lt;SPAN&gt;ShellLayerType&lt;/SPAN&gt;.Interior).First();
	&lt;SPAN&gt;Face&lt;/SPAN&gt;&amp;nbsp;face&amp;nbsp;=&amp;nbsp;document.GetElement(reference).GetGeometryObjectFromReference(reference)&amp;nbsp;&lt;SPAN&gt;as&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;Face&lt;/SPAN&gt;;
	&lt;SPAN&gt;XYZ&lt;/SPAN&gt;&amp;nbsp;location&amp;nbsp;=&amp;nbsp;face.Project(mid).XYZPoint;
	&lt;SPAN&gt;Transaction&lt;/SPAN&gt;&amp;nbsp;t&amp;nbsp;=&amp;nbsp;&lt;SPAN&gt;new&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;Transaction&lt;/SPAN&gt;(document);
	t.Start(&lt;SPAN&gt;"transaction"&lt;/SPAN&gt;);
	&lt;SPAN&gt;XYZ&lt;/SPAN&gt;&amp;nbsp;refDir&amp;nbsp;=&amp;nbsp;&lt;SPAN&gt;new&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;XYZ&lt;/SPAN&gt;(0,&amp;nbsp;0,&amp;nbsp;0);
	&lt;SPAN&gt;FamilyInstance&lt;/SPAN&gt;&amp;nbsp;instance&amp;nbsp;=&amp;nbsp;document.Create.NewFamilyInstance(reference,&amp;nbsp;location,&amp;nbsp;refDir,&amp;nbsp;symbol);
	t.Commit();
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 20:11:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6706324#M77085</guid>
      <dc:creator>BardiaJahan</dc:creator>
      <dc:date>2016-11-23T20:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: family instance on reference plane with API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6706463#M77086</link>
      <description>A way I have gotten around newfamilyinstance placement method limitations is to use promptforfamilyinstanceplacement, but wrapped in a document changed event, and doing post-checking on the placed instances, and rehosting, rotating, or altering parameters in an additional transaction.</description>
      <pubDate>Wed, 23 Nov 2016 21:01:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6706463#M77086</guid>
      <dc:creator>matthew_taylor</dc:creator>
      <dc:date>2016-11-23T21:01:16Z</dc:date>
    </item>
    <item>
      <title>Re: family instance on reference plane with API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6706715#M77087</link>
      <description>&lt;P&gt;Thanks for the reply!&lt;/P&gt;&lt;P&gt;The device point is the midpoint of the wall segment plus an offset above the floor to set the device height:&lt;/P&gt;&lt;P&gt;Dim pt As XYZ = Midpoint(seg.StartPoint, seg.EndPoint)&lt;BR /&gt;Dim DevicePoint&amp;nbsp;as XYZ = NewPt(pt.X, pt.Y, SpacePoint.Z + (DeviceOffset / 12))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It doesn't work&amp;nbsp;when the wall is interior on both sides. &amp;nbsp;It will work in one room but in the adjacent room the device on the same adjoining wall will be flipped.&lt;/P&gt;&lt;P&gt;No problem on exterior walls at all. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 22:38:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6706715#M77087</guid>
      <dc:creator>tf</dc:creator>
      <dc:date>2016-11-23T22:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: family instance on reference plane with API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6706721#M77088</link>
      <description>Thanks for the reply! The device point is the midpoint of the wall segment plus an offset above the floor to set the device height: Dim pt As XYZ = Midpoint(seg.StartPoint, seg.EndPoint) Dim DevicePoint as XYZ = NewPt(pt.X, pt.Y, SpacePoint.Z + (DeviceOffset / 12)) It doesn't work when the wall is interior on both sides. It will work in one room but in the adjacent room the device on the same adjoining wall will be flipped. No problem on exterior walls at all. Thanks</description>
      <pubDate>Wed, 23 Nov 2016 22:42:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6706721#M77088</guid>
      <dc:creator>tf</dc:creator>
      <dc:date>2016-11-23T22:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: family instance on reference plane with API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6706735#M77089</link>
      <description>&lt;P&gt;Thank you. &amp;nbsp;I tried that. &amp;nbsp;Unfortunately, the incorrectly flipped device can't be rotated or flipped. &amp;nbsp;Its as if it thinks it is inserted correctly. &amp;nbsp;The error is to the effect that the can't rotate to that position. &amp;nbsp;I could go to unhosted devices but that seems to defeat the purpose of revit.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 22:48:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6706735#M77089</guid>
      <dc:creator>tf</dc:creator>
      <dc:date>2016-11-23T22:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: family instance on reference plane with API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6706810#M77090</link>
      <description>@tf did you use promptforfamilyinstanceplacement though? Once you have a family placed correctly, you can fairly easily swap it out for another one. Just get its info (you may need to regen first), delete it, and place a new one. Hoops to jump through, but it allows you to forget about most of the maths.@Anonymous did you use promptforfamilyinstanceplacement though? Once you have a family placed correctly, you can fairly easily swap it out for another one. Just get its info (you may need to regen first), delete it, and place a new one. Hoops to jump through, but it allows you to forget about most of the maths.&lt;BR /&gt;Otherwise, you need to get your transforms, normals, etc well thought out.</description>
      <pubDate>Wed, 23 Nov 2016 23:37:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6706810#M77090</guid>
      <dc:creator>matthew_taylor</dc:creator>
      <dc:date>2016-11-23T23:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: family instance on reference plane with API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6706918#M77091</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/98018"&gt;@matthew_taylor&lt;/a&gt; &amp;nbsp;No we did not use &amp;nbsp;&lt;SPAN&gt;promptforfamilyinstanceplacement. &amp;nbsp; We are&amp;nbsp;&lt;/SPAN&gt;parametrically placing all the devices in the room. &amp;nbsp;By knowing the door location we know that the wall diagonally across from the door needs a quad receptical and a data jack. &amp;nbsp;All other walls need a duplex receptacle spaced 7' apart. &amp;nbsp;Also because we know the door location we can locate the lightswitch. &amp;nbsp;Ideally, all of this done without much human intervention.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you think in the above scenario there is a way to use the &lt;SPAN&gt;promptforfamilyinstanceplacement &amp;nbsp;command programatically with minimal user input.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Really appreciate the help...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2016 00:41:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6706918#M77091</guid>
      <dc:creator>tf</dc:creator>
      <dc:date>2016-11-24T00:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: family instance on reference plane with API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6707139#M77092</link>
      <description>@tf@Anonymous&lt;BR /&gt;Riiiiight. Gotcha. That actually hit me in the middle of the night! &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;You need to get the Normal of the wall Face to use as the reference direction. It isn't a global 'use all' direction. I'm pretty sure that the building coder has a sample that computes the normal of a face. I think the code is something like  face.ComputeNormal(UV.Zero)&lt;BR /&gt;&lt;BR /&gt;Test with a series of walls that have been arrayed 360 degrees around a point. Any issues in your code will become transparent.&lt;BR /&gt;&lt;BR /&gt;-Matt</description>
      <pubDate>Thu, 24 Nov 2016 05:56:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6707139#M77092</guid>
      <dc:creator>matthew_taylor</dc:creator>
      <dc:date>2016-11-24T05:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: family instance on reference plane with API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6708099#M77093</link>
      <description>Thanks. I am struggling with that. I have the normal vector but I haven't been able to figure out how to translate it to a relevant Reference direction.&lt;BR /&gt;Looks like I am going in the right diection. Now I need to figure out how to make it work. Thank you...</description>
      <pubDate>Thu, 24 Nov 2016 15:41:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6708099#M77093</guid>
      <dc:creator>tf</dc:creator>
      <dc:date>2016-11-24T15:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: family instance on reference plane with API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6720128#M77094</link>
      <description>&lt;P&gt;using HostObjectUtils.GetSideFaces()&amp;nbsp;will give you an reference&amp;nbsp;for some internal reference-plane, and not the "real" face of the wall. This may explain why the placed instances do not behave properly.&amp;nbsp;On top of that, both&amp;nbsp;the interior and the exterior plane have the same normal vector,&amp;nbsp;explaining&amp;nbsp;why some instances will disappear in the wall.&lt;/P&gt;&lt;P&gt;The solution will be to find the "real"faces of the wall.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Options opt = new Options();&lt;/P&gt;&lt;P&gt;opt.ComputeReferences =true;&lt;/P&gt;&lt;P&gt;opt.DetailLevel = ViewDetailLevel.Coarse;&lt;/P&gt;&lt;P&gt;GeometryElement geoElem = element.get_Geometry(opt);&lt;/P&gt;&lt;P&gt;foreach (Autodesk.Revit.DB.GeometryObject geomObj in geoElem)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; Autodesk.Revit.DB.Solid solid = geomObj as Autodesk.Revit.DB.Solid;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (null != solid)&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (Face f in solid.Faces)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//&amp;nbsp; test for correct normal vector succeeded, select f&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; Autodesk.Revit.DB.GeometryInstance geomInst = geomObj as Autodesk.Revit.DB.GeometryInstance;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (null != geomInst)&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Autodesk.Revit.DB.GeometryElement transformedGeomElem = geomInst.GetSymbolGeometry();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // &amp;nbsp;find faces in transformedGeoElem&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;Once you have the correct face, you can use either the face or face.Reference in the call&lt;/P&gt;&lt;P&gt;document.Create.NewFamilyInstance()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2016 23:39:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6720128#M77094</guid>
      <dc:creator>FAIR59</dc:creator>
      <dc:date>2016-11-30T23:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: family instance on reference plane with API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6720233#M77095</link>
      <description>Thanks very much. We will give it a shot...</description>
      <pubDate>Thu, 01 Dec 2016 01:07:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6720233#M77095</guid>
      <dc:creator>tf</dc:creator>
      <dc:date>2016-12-01T01:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: family instance on reference plane with API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6722585#M77096</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2083518"&gt;@FAIR59&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Thanks very much. &amp;nbsp;Having trouble determining which face has the correct normal. &amp;nbsp;I know the space point and could compare to that but that may not work in all instances such as an L-shaped room. &amp;nbsp;Any ideas would be greatly appreciated.&lt;/P&gt;&lt;P&gt;Also, &amp;nbsp;Once the face is found why do&amp;nbsp;we need to find the face in the TransformedGeoElem and how do we get the face corresponding to f.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2016 20:41:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6722585#M77096</guid>
      <dc:creator>tf</dc:creator>
      <dc:date>2016-12-01T20:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: family instance on reference plane with API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6722894#M77097</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4251896"&gt;@tf&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think the main reason behind what is happening is that your location point is not on the reference plane you are using (I think you can still use HostObjectUtils.GetSideFaces though&amp;nbsp;). For some interior walls, you need to place the receptacle on the exterior side in order to be inside the room!&lt;/P&gt;&lt;P&gt;You need to find which face is actually facing toward the room. (I think it was already suggested in the thread). One workflow is to use room.GetBoundarySegments to retrieve the boundary and iterate through the segments to find which side of your wall is overlapped with at least one of the segments. Then, that would be your reference plane to place the receptacle in that room.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2016 22:39:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6722894#M77097</guid>
      <dc:creator>BardiaJahan</dc:creator>
      <dc:date>2016-12-01T22:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: family instance on reference plane with API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6723055#M77098</link>
      <description>&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4145125"&gt;@BardiaJahan&lt;/a&gt;,&lt;BR /&gt;Thanks for the reply. We are definetly getting the correct face as we are doing what you suggest, but it places the receptacle on tbe wrong side of the interior face so that it sticks into the wall.&lt;BR /&gt;I feel we are getting close with all the help on this forum!!&lt;BR /&gt;</description>
      <pubDate>Fri, 02 Dec 2016 00:29:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6723055#M77098</guid>
      <dc:creator>tf</dc:creator>
      <dc:date>2016-12-02T00:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: family instance on reference plane with API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6723723#M77099</link>
      <description>&lt;P&gt;@ tf&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was too hasty in dismissing the use of HostObjectUtils.GetSideFaces().&lt;/P&gt;&lt;P&gt;I can now place an Electrical Fixture (facebased) correctly using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;LocationCurve&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; lc = wall.Location &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;as&lt;/FONT&gt; &lt;FONT color="#2b91af" face="Consolas" size="2"&gt;LocationCurve&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;XYZ&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; mid = lc.Curve.Evaluate(0.5, &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;true&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;).Add(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;new&lt;/FONT&gt; &lt;FONT color="#2b91af" face="Consolas" size="2"&gt;XYZ&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;(0,0,1));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;Reference&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; reference = &lt;/FONT&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;HostObjectUtils&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;.GetSideFaces(wall, &lt;/FONT&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;ShellLayerType&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;.Interior).First();&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; (reference == &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;null&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;continue&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;Face&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; _RefFace = element.GetGeometryObjectFromReference(reference) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;as&lt;/FONT&gt; &lt;FONT color="#2b91af" face="Consolas" size="2"&gt;Face&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;location = _RefFace.Project(mid).XYZPoint;&lt;/P&gt;&lt;P&gt;instance = document.Create.NewFamilyInstance(reference , location, _RefFace.ComputeDerivatives(_RefFace.Project(location).UVPoint).BasisX.Normalize(), symbol);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2016 11:55:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/family-instance-on-reference-plane-with-api/m-p/6723723#M77099</guid>
      <dc:creator>FAIR59</dc:creator>
      <dc:date>2016-12-02T11:55:58Z</dc:date>
    </item>
  </channel>
</rss>

