<?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: get element from XYZ in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/get-element-from-xyz/m-p/9876011#M30379</link>
    <description>&lt;P&gt;You can use PickObject. That will give you both the point and the element.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 17 Nov 2020 18:07:20 GMT</pubDate>
    <dc:creator>jeremytammik</dc:creator>
    <dc:date>2020-11-17T18:07:20Z</dc:date>
    <item>
      <title>get element from XYZ</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-element-from-xyz/m-p/9875965#M30378</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Is it possible to retrieve the &lt;U&gt;&lt;STRONG&gt;element&lt;/STRONG&gt; &lt;/U&gt;when selecting with this method ?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Dim StartPoint As XYZ = Sel.PickPoint (ObjectSnapTypes.Endpoints, "Insert Point")&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Because the StartPoint is on an element !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 17:53:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-element-from-xyz/m-p/9875965#M30378</guid>
      <dc:creator>ahmed.errazak</dc:creator>
      <dc:date>2020-11-17T17:53:24Z</dc:date>
    </item>
    <item>
      <title>Re: get element from XYZ</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-element-from-xyz/m-p/9876011#M30379</link>
      <description>&lt;P&gt;You can use PickObject. That will give you both the point and the element.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 18:07:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-element-from-xyz/m-p/9876011#M30379</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2020-11-17T18:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: get element from XYZ</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-element-from-xyz/m-p/9876023#M30380</link>
      <description>&lt;P&gt;No an XYZ (the only thing returned from that method) does not uniquely define an element e.g. two beams can connect at an end point.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You should use&amp;nbsp;Selection.PickObject(Selection.ObjectType.PointOnElement), this returns a Reference.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 18:09:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-element-from-xyz/m-p/9876023#M30380</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2020-11-17T18:09:39Z</dc:date>
    </item>
    <item>
      <title>Re: get element from XYZ</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-element-from-xyz/m-p/9876064#M30381</link>
      <description>&lt;P&gt;As others have noted, if the point being selected is always going to be a point on an element, use PickObject instead of PickPoint.&amp;nbsp;&lt;/P&gt;&lt;P&gt;But maybe you want to let the user pick anywhere and then determine if there is an object at that point. In this case, PickObject is no good because it will not let you pick in empty space. So if this is your goal, use PickPoint, create a little spherical solid at that point (see code below), and then use an&amp;nbsp;ElementIntersectsSolidFilter to see if there is an element that intersects that sphere.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;                double radius = 0.2;
                Arc arc = Arc.Create(
                  xyz - radius * XYZ.BasisZ,
                  xyz + radius * XYZ.BasisZ,
                  xyz + radius * XYZ.BasisX);

                Line line = Line.CreateBound(
                  arc.GetEndPoint(1),
                  arc.GetEndPoint(0));

                CurveLoop halfCircle = new CurveLoop();
                halfCircle.Append(arc);
                halfCircle.Append(line);

                List&amp;lt;CurveLoop&amp;gt; loops = new List&amp;lt;CurveLoop&amp;gt;
                {
                    halfCircle
                };

                Frame frame = new Frame(xyz, XYZ.BasisX, XYZ.BasisY, XYZ.BasisZ);
                Solid sphere = GeometryCreationUtilities.CreateRevolvedGeometry(frame, loops, 0, 2 * Math.PI);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 18:30:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-element-from-xyz/m-p/9876064#M30381</guid>
      <dc:creator>boostyourbim</dc:creator>
      <dc:date>2020-11-17T18:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: get element from XYZ</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-element-from-xyz/m-p/9877595#M30382</link>
      <description>&lt;P&gt;Sorry, it's my fault, I wasn't very concrete in my explanation&lt;/P&gt;&lt;P&gt;the point is that I must define the insertion angle of my valve in advance&lt;BR /&gt;so I can predict the orientation of my valve and my motor&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to explain it below with a sketch&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Orientation-Angle.PNG" style="width: 808px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/845678i02E7315402FFDD9E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Orientation-Angle.PNG" alt="Orientation-Angle.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2020 09:57:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-element-from-xyz/m-p/9877595#M30382</guid>
      <dc:creator>ahmed.errazak</dc:creator>
      <dc:date>2020-11-18T09:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: get element from XYZ</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-element-from-xyz/m-p/9877932#M30383</link>
      <description>&lt;P&gt;With PickObject you can get the XYZ location where the mouse was clicked. Get the reference from the pick and the GlobalPoint property.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;		public void point()
		{
			UIDocument uidoc = this.ActiveUIDocument;
			Document doc = this.ActiveUIDocument.Document;
			Reference r = uidoc.Selection.PickObject(ObjectType.Element);
			TaskDialog.Show("point", r.GlobalPoint.ToString());
		}&lt;/LI-CODE&gt;&lt;P&gt;.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2020 12:18:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-element-from-xyz/m-p/9877932#M30383</guid>
      <dc:creator>boostyourbim</dc:creator>
      <dc:date>2020-11-18T12:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: get element from XYZ</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-element-from-xyz/m-p/9877987#M30384</link>
      <description>&lt;P&gt;Is the pipe there already before you add your fitting?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this is the case why do you need to pick two points? By picking the pipe element intersecting the wall you have two end points one near the wall and one further away from the wall. So get the distance of both from the Face.Project(XYZ) and then order them as such for direction. Do you really want a user to be picking two points when they can pick one pipe? Test that pipe end is within distance of wall to decide if it is a valid candidate for selection i.e. pipe stops at wall. Probably also you could select system and automatically add all outlets if you pick also the wall(s) they end at (going one step further).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the pipe isn't there then the orientation is any direction you want. From a structural preference standpoint the shortest distance through a wall is perpendicular (face normal).&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2020 12:46:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-element-from-xyz/m-p/9877987#M30384</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2020-11-18T12:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: get element from XYZ</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-element-from-xyz/m-p/9878258#M30385</link>
      <description>&lt;P&gt;It may be easier to place the fittings first, exactly where you want them, and then add the pipes afterwards.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please study the series of different approaches I tried out to implement a rolling offset:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2014/01/final-rolling-offset-using-pipecreate.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2014/01/final-rolling-offset-using-pipecreate.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2020 14:20:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-element-from-xyz/m-p/9878258#M30385</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2020-11-18T14:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: get element from XYZ</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-element-from-xyz/m-p/9878641#M30386</link>
      <description>&lt;P&gt;Yes the Global Point would be a solution, but only for part of the problem!&lt;BR /&gt;see sketch&lt;BR /&gt;that would be for the upper part (from 0 ° to 180 °)&lt;BR /&gt;but I would be stuck for the lower part (from 180 ° to 360 °)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Angle and Orientation.PNG" style="width: 656px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/845887iCD57E75E94AC07E3/image-size/large?v=v2&amp;amp;px=999" role="button" title="Angle and Orientation.PNG" alt="Angle and Orientation.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2020 16:42:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-element-from-xyz/m-p/9878641#M30386</guid>
      <dc:creator>ahmed.errazak</dc:creator>
      <dc:date>2020-11-18T16:42:07Z</dc:date>
    </item>
  </channel>
</rss>

