{"id":2752,"date":"2024-09-25T08:55:06","date_gmt":"2024-09-25T08:55:06","guid":{"rendered":"https:\/\/infralligence.com\/?p=2752"},"modified":"2024-12-31T09:29:51","modified_gmt":"2024-12-31T09:29:51","slug":"selecting-and-picking-elements-in-revit-api","status":"publish","type":"post","link":"https:\/\/infralligence.com\/pl\/resources\/selecting-and-picking-elements-in-revit-api\/","title":{"rendered":"Selecting and Picking Elements in Revit API"},"content":{"rendered":"<div data-elementor-type=\"wp-post\" data-elementor-id=\"2752\" class=\"elementor elementor-2752\">\n\t\t\t\t<div class=\"elementor-element elementor-element-a636728 e-con-full kk-blog-post e-flex rael-particle-no e-con e-parent\" data-id=\"a636728\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-978bece elementor-widget elementor-widget-text-editor\" data-id=\"978bece\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Selecting elements or geometries in your plugin is possible with the\u00a0<strong>Selection\u00a0<\/strong>class.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-acc30ef elementor-widget elementor-widget-image\" data-id=\"acc30ef\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img fetchpriority=\"high\" decoding=\"async\" width=\"2653\" height=\"1493\" src=\"https:\/\/infralligence.com\/wp-content\/uploads\/2024\/12\/4450c1d3-83a7-4dc6-a217-820281e6b8af.png\" class=\"attachment-full size-full wp-image-2754\" alt=\"\" srcset=\"https:\/\/infralligence.com\/wp-content\/uploads\/2024\/12\/4450c1d3-83a7-4dc6-a217-820281e6b8af.png 2653w, https:\/\/infralligence.com\/wp-content\/uploads\/2024\/12\/4450c1d3-83a7-4dc6-a217-820281e6b8af-300x169.png 300w, https:\/\/infralligence.com\/wp-content\/uploads\/2024\/12\/4450c1d3-83a7-4dc6-a217-820281e6b8af-1024x576.png 1024w, https:\/\/infralligence.com\/wp-content\/uploads\/2024\/12\/4450c1d3-83a7-4dc6-a217-820281e6b8af-768x432.png 768w, https:\/\/infralligence.com\/wp-content\/uploads\/2024\/12\/4450c1d3-83a7-4dc6-a217-820281e6b8af-1536x864.png 1536w, https:\/\/infralligence.com\/wp-content\/uploads\/2024\/12\/4450c1d3-83a7-4dc6-a217-820281e6b8af-2048x1153.png 2048w\" sizes=\"(max-width: 2653px) 100vw, 2653px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-98d5948 elementor-widget elementor-widget-text-editor\" data-id=\"98d5948\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h5>\ud83d\udccc TLDR \u2013 Summary Upfront:<\/h5><p>Use Selection class to:<br \/>\u27a1\ufe0f <strong>Get currently selected elements<\/strong> \u200bwith Selection.GetElementIds().<br \/>\u27a1\ufe0f <strong>Prompt the user to select elements<\/strong> with various Pick[\u2026] methods (PickObject, PickObjects, PickPoint, \u2026).<br \/>\u27a1\ufe0f <strong>Set selected elements programmatically<\/strong> with Selection.SetElementIds().<\/p><p>The <strong>Selection Filter<\/strong> allows you to set additional rules for Elements to select<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-ecaaabc elementor-widget elementor-widget-rael-table-of-contents\" data-id=\"ecaaabc\" data-element_type=\"widget\" data-e-type=\"widget\" data-settings=\"{&quot;rael_headings_by_tags&quot;:[&quot;h3&quot;,&quot;h4&quot;],&quot;rael_exclude_headings_by_selector&quot;:[],&quot;rael_min_height&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:0,&quot;sizes&quot;:[]},&quot;rael_marker_view&quot;:&quot;numbers&quot;,&quot;rael_hierarchical_view&quot;:&quot;yes&quot;,&quot;rael_min_height_tablet&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;rael_min_height_mobile&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]}}\" data-widget_type=\"rael-table-of-contents.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"rael-toc__header\">\n\t\t\t\t<h5 class=\"rael-toc__header-title\">\ud83d\udd0dContent: <\/h5>\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"rael-toc__body\">\n\t\t\t<div class=\"rael-toc__spinner-container\">\n\t\t\t\t<i class=\"rael-toc__spinner eicon-loading eicon-animation-spin\" aria-hidden=\"true\"><\/i>\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6ef7c88 elementor-widget elementor-widget-text-editor\" data-id=\"6ef7c88\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h3>Accessing the Selection class<\/h3><p>The <strong>Selection<\/strong> class (from Autodesk.Revit.UI.Selection) allows retrieving already selected elements, setting new selections, and prompting users to select elements or geometries within your Revit plugins.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6fe9a98 elementor-widget elementor-widget-code-block-for-elementor\" data-id=\"6fe9a98\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-block-for-elementor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre class='line-numbers theme-default' data-show-toolbar='no'><code class='language-csharp'>var uiApp = commandData.Application;\nvar uiDoc = uiApp.ActiveUIDocument;\nvar doc = uiDoc.Document;\n\nvar selectionManager = uiDoc.Selection;<\/code><\/pre>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-38f5976 elementor-widget elementor-widget-text-editor\" data-id=\"38f5976\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h3>Ways to get selected elements<\/h3><p>\u2022 <strong>Retrieving pre-selected elements:<\/strong><br \/>Get elements that were selected before your method runs<\/p><p>\u2022 <strong>Requesting user selection:<\/strong><br \/>Prompt the user to select elements after your method starts (e.g., after a button click).<\/p><p>\u2022 <strong>Mixed approach:<\/strong><br \/>Retrieve already selected elements, or if no elements are selected, prompt the user for selection.<\/p><h4>Retrieving pre-selected elements<\/h4><p>To retrieve elements selected before running your method, use the\u00a0<strong>Selection.GetElementIds<\/strong>.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-a02350f elementor-widget elementor-widget-code-block-for-elementor\" data-id=\"a02350f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-block-for-elementor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre class='line-numbers theme-default' data-show-toolbar='no'><code class='language-csharp'>var selectedElementsIds = selectionManager.GetElementIds();\nTaskDialog.Show(&quot;Selected Elements&quot;, $&quot;Selected elements number: {selectedElementsIds.Count}&quot;);<\/code><\/pre>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-4f0e92c elementor-widget elementor-widget-text-editor\" data-id=\"4f0e92c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h4>Requesting user selection<\/h4><p>To request the user to select elements, you can use a variety of Pick[\u2026] methods:<\/p><p>\u2022 <strong>PickObject<\/strong> and <strong>PickObjects<\/strong>: select one or multiple elements of various types<br \/>Specify the Element type (Element, PointOnElement, Edge, Face, LinkedElement, Subelement) with the ObjectType enumerator.<\/p><p>\u2022 <strong>PickPoint<\/strong>: select a point.<\/p><p>\u2022 <strong>PickElementsByRectangle<\/strong>: select elements by drawing a rectangle on the screen.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-88112e9 elementor-widget elementor-widget-code-block-for-elementor\" data-id=\"88112e9\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-block-for-elementor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre class='line-numbers theme-default' data-show-toolbar='no'><code class='language-csharp'>\/\/ Picking objects (Elements, geometries) - requesting the user to select\nvar elementReference = selectionManager.PickObject(ObjectType.Element, &quot;Select element&quot;);\nvar element = doc.GetElement(elementReference);\nTaskDialog.Show(&quot;Picked Element&quot;, $&quot;Element: {element.Name}&quot;);\n\nvar elementsReferences = selectionManager.PickObjects(ObjectType.Element, &quot;Select elements&quot;);\nTaskDialog.Show(&quot;Picked Elements&quot;, $&quot;Elements number: {elementsReferences.Count}&quot;);\n\t\n\/\/ Picking an edge\nReference edgeRef = selectionManager.PickObject(ObjectType.Edge, &quot;Select an edge&quot;);\nEdge edge = doc.GetElement(edgeRef.ElementId).GetGeometryObjectFromReference(edgeRef) as Edge;\nTaskDialog.Show(&quot;Picked Edge&quot;, $&quot;Edge length: {edge.ApproximateLength}&quot;);\n\n\/\/ Picking a point\nvar xyz = selectionManager.PickPoint(ObjectSnapTypes.Midpoints, &quot;Select a midpoint&quot;);\nTaskDialog.Show(&quot;Picked Point&quot;, $&quot;Point coordinates: {xyz}&quot;);\n\n\/\/ Picking elements by rectangle\nvar elementsSelected = selectionManager.PickElementsByRectangle(&quot;Select elements by rectangle&quot;);\nvar elementNames = string.Join(&quot;, &quot;, elementsSelected.Select(e =&gt; e.Name));\nTaskDialog.Show(&quot;Picked Elements by Rectangle&quot;, $&quot;Elements: {elementNames}&quot;);<\/code><\/pre>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-15c3cf8 elementor-widget elementor-widget-text-editor\" data-id=\"15c3cf8\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h4>Convenient Mixed Approach: Retrieving or Requesting Selection<\/h4><p>To enhance user experience, you can retrieve already selected elements or, if none are selected, prompt the user to make a selection.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-075c0c8 elementor-widget elementor-widget-code-block-for-elementor\" data-id=\"075c0c8\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-block-for-elementor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre class='line-numbers theme-default' data-show-toolbar='no'><code class='language-csharp'>\/\/ Mixed approach -retrieving the selected elements or, if none are selected, requesting to select\nvar selectedElementsIds = selectionManager.GetElementIds();\nif (selectedElementsIds.Count == 0)\n{\n\t\/\/ Use the pick object method to select an element\n\tvar elementsReferences = selectionManager.PickObjects(ObjectType.Element, &quot;Select elements&quot;);\n\tselectedElementsIds = elementsReferences.Select(r =&gt; r.ElementId).ToList();\n}\nTaskDialog.Show(&quot;Selected Elements&quot;, $&quot;Selected elements number: {selectedElementsIds.Count}&quot;);<\/code><\/pre>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b8795f9 elementor-widget elementor-widget-text-editor\" data-id=\"b8795f9\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h3>Applying a Selection Filter<\/h3><p>You might need to set <strong>strict rules for elements available for selection<\/strong> (for example, selecting <strong>only walls of a certain width<\/strong>). In such cases, apply a Selection Filter.<\/p><p>To define a Selection Filter, create a class implementing the <strong>ISelectionFilter<\/strong> interface. Below are examples of two filters and their usage.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-077bf8b elementor-widget elementor-widget-code-block-for-elementor\" data-id=\"077bf8b\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-block-for-elementor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre class='line-numbers theme-default' data-show-toolbar='no'><code class='language-csharp'>\/\/ Applying the selection filter\nvar wallSelectionFilter = new ElementTypesSelectionFilter(typeof(Wall));\nvar wallReference = selectionManager.PickObject(ObjectType.Element, wallSelectionFilter, &quot;Select a wall&quot;);\n\nvar wallAndFloorSelectionFilter = new ElementTypesSelectionFilter(typeof(Wall), typeof(Floor));\nvar wallOrFloorReference = selectionManager.PickObject(ObjectType.Element, wallAndFloorSelectionFilter, &quot;Select a wall or a floor&quot;);\n\nvar minimumWidthWallSelectionFilter = new MinimumWidthWallsSelectionFilter(1); \/\/ remember - by default, width unit is Feet\nvar minimumWidthWallReference = selectionManager.PickObject(ObjectType.Element, minimumWidthWallSelectionFilter, &quot;Select a wall with a minimum width of 1 foot&quot;);\n\n\n\/\/ SelectionFilter classes\nclass ElementTypesSelectionFilter : ISelectionFilter\n{\n\tprivate readonly Type[] allowedTypes;\n\n\tpublic ElementTypesSelectionFilter(params Type[] allowedTypes)\n\t{\n\t\tthis.allowedTypes = allowedTypes;\n\t}\n\n\tpublic bool AllowElement(Element element)\n\t{\n\t\treturn allowedTypes.Contains(element.GetType());\n\t}\n\n\tpublic bool AllowReference(Reference reference, XYZ position)\n\t{\n\t\treturn false;\n\t}\n}\n\nclass MinimumWidthWallsSelectionFilter : ISelectionFilter\n{\n\tprivate readonly double minimumWidth;\n\n\tpublic MinimumWidthWallsSelectionFilter(double minimumWidth)\n\t{\n\t\tthis.minimumWidth = minimumWidth;\n\t}\n\n\tpublic bool AllowElement(Element element)\n\t{\n\t\tif (element is Wall wall) return wall.Width &gt;= minimumWidth;\n\t\t\t\n\t\treturn false;\n\t}\n\n\tpublic bool AllowReference(Reference reference, XYZ position)\n\t{\n\t\treturn false;\n\t}\n}<\/code><\/pre>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2f05bf8 elementor-widget elementor-widget-text-editor\" data-id=\"2f05bf8\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h3>Setting selection<\/h3><p>You can also set the selection programmatically within your method with <strong>Selection.SetElementIds<\/strong>.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-88b0a17 elementor-widget elementor-widget-code-block-for-elementor\" data-id=\"88b0a17\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-block-for-elementor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre class='line-numbers theme-default' data-show-toolbar='no'><code class='language-csharp'>var wallsIds = new FilteredElementCollector(doc)\n.OfClass(typeof(Wall))\n.WhereElementIsNotElementType()\n.ToElementIds();\n\nselectionManager.SetElementIds(wallsIds);<\/code><\/pre>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>","protected":false},"excerpt":{"rendered":"<p>Selecting elements or geometries in your plugin is possible with the\u00a0Selection\u00a0class. \ud83d\udccc TLDR \u2013 Summary Upfront: Use Selection class to:\u27a1\ufe0f Get currently selected elements \u200bwith Selection.GetElementIds().\u27a1\ufe0f Prompt the user to select elements with various Pick[\u2026] methods (PickObject, PickObjects, PickPoint, \u2026).\u27a1\ufe0f Set selected elements programmatically with Selection.SetElementIds(). The Selection Filter allows you to set additional rules [&hellip;]<\/p>","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[6],"tags":[],"post_folder":[],"class_list":["post-2752","post","type-post","status-publish","format-standard","hentry","category-revit-api-basics"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Selecting and Picking Elements in Revit API - Infralligence<\/title>\n<meta name=\"description\" content=\"Use the Selection class to: retrieve pre-selected elements, request user selection, set selected elements programmatically...\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/infralligence.com\/pl\/resources\/selecting-and-picking-elements-in-revit-api\/\" \/>\n<meta property=\"og:locale\" content=\"pl_PL\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Selecting and Picking Elements in Revit API - Infralligence\" \/>\n<meta property=\"og:description\" content=\"Use the Selection class to: retrieve pre-selected elements, request user selection, set selected elements programmatically...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/infralligence.com\/pl\/resources\/selecting-and-picking-elements-in-revit-api\/\" \/>\n<meta property=\"og:site_name\" content=\"Infralligence\" \/>\n<meta property=\"article:published_time\" content=\"2024-09-25T08:55:06+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-12-31T09:29:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/infralligence.com\/wp-content\/uploads\/2024\/12\/4450c1d3-83a7-4dc6-a217-820281e6b8af.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2653\" \/>\n\t<meta property=\"og:image:height\" content=\"1493\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Kamil Korus\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Napisane przez\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kamil Korus\" \/>\n\t<meta name=\"twitter:label2\" content=\"Szacowany czas czytania\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minuty\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/infralligence.com\/resources\/selecting-and-picking-elements-in-revit-api\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/infralligence.com\/resources\/selecting-and-picking-elements-in-revit-api\/\"},\"author\":{\"name\":\"Kamil Korus\",\"@id\":\"https:\/\/infralligence.com\/#\/schema\/person\/838177275b7d3b8b217b13180a74aeda\"},\"headline\":\"Selecting and Picking Elements in Revit API\",\"datePublished\":\"2024-09-25T08:55:06+00:00\",\"dateModified\":\"2024-12-31T09:29:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/infralligence.com\/resources\/selecting-and-picking-elements-in-revit-api\/\"},\"wordCount\":321,\"publisher\":{\"@id\":\"https:\/\/infralligence.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/infralligence.com\/resources\/selecting-and-picking-elements-in-revit-api\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/infralligence.com\/wp-content\/uploads\/2024\/12\/4450c1d3-83a7-4dc6-a217-820281e6b8af.png\",\"articleSection\":[\"Revit API Basics\"],\"inLanguage\":\"pl-PL\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/infralligence.com\/resources\/selecting-and-picking-elements-in-revit-api\/\",\"url\":\"https:\/\/infralligence.com\/resources\/selecting-and-picking-elements-in-revit-api\/\",\"name\":\"Selecting and Picking Elements in Revit API - Infralligence\",\"isPartOf\":{\"@id\":\"https:\/\/infralligence.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/infralligence.com\/resources\/selecting-and-picking-elements-in-revit-api\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/infralligence.com\/resources\/selecting-and-picking-elements-in-revit-api\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/infralligence.com\/wp-content\/uploads\/2024\/12\/4450c1d3-83a7-4dc6-a217-820281e6b8af.png\",\"datePublished\":\"2024-09-25T08:55:06+00:00\",\"dateModified\":\"2024-12-31T09:29:51+00:00\",\"description\":\"Use the Selection class to: retrieve pre-selected elements, request user selection, set selected elements programmatically...\",\"breadcrumb\":{\"@id\":\"https:\/\/infralligence.com\/resources\/selecting-and-picking-elements-in-revit-api\/#breadcrumb\"},\"inLanguage\":\"pl-PL\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/infralligence.com\/resources\/selecting-and-picking-elements-in-revit-api\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"pl-PL\",\"@id\":\"https:\/\/infralligence.com\/resources\/selecting-and-picking-elements-in-revit-api\/#primaryimage\",\"url\":\"https:\/\/infralligence.com\/wp-content\/uploads\/2024\/12\/4450c1d3-83a7-4dc6-a217-820281e6b8af.png\",\"contentUrl\":\"https:\/\/infralligence.com\/wp-content\/uploads\/2024\/12\/4450c1d3-83a7-4dc6-a217-820281e6b8af.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/infralligence.com\/resources\/selecting-and-picking-elements-in-revit-api\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/infralligence.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Selecting and Picking Elements in Revit API\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/infralligence.com\/#website\",\"url\":\"https:\/\/infralligence.com\/\",\"name\":\"Infralligence\",\"description\":\"Digital Automation and AI for civil engineering\",\"publisher\":{\"@id\":\"https:\/\/infralligence.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/infralligence.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"pl-PL\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/infralligence.com\/#organization\",\"name\":\"Infralligence\",\"url\":\"https:\/\/infralligence.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pl-PL\",\"@id\":\"https:\/\/infralligence.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/infralligence.com\/wp-content\/uploads\/2024\/11\/android-chrome-192x192-1.png\",\"contentUrl\":\"https:\/\/infralligence.com\/wp-content\/uploads\/2024\/11\/android-chrome-192x192-1.png\",\"width\":192,\"height\":192,\"caption\":\"Infralligence\"},\"image\":{\"@id\":\"https:\/\/infralligence.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/infralligence.com\/#\/schema\/person\/838177275b7d3b8b217b13180a74aeda\",\"name\":\"Kamil Korus\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pl-PL\",\"@id\":\"https:\/\/infralligence.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/95bd7da2ac29ff34a2ab9bf4ea30273b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/95bd7da2ac29ff34a2ab9bf4ea30273b?s=96&d=mm&r=g\",\"caption\":\"Kamil Korus\"},\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/kamil-korus\/\"],\"url\":\"https:\/\/infralligence.com\/pl\/resources\/author\/kamil-korus\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Selecting and Picking Elements in Revit API - Infralligence","description":"Use the Selection class to: retrieve pre-selected elements, request user selection, set selected elements programmatically...","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/infralligence.com\/pl\/resources\/selecting-and-picking-elements-in-revit-api\/","og_locale":"pl_PL","og_type":"article","og_title":"Selecting and Picking Elements in Revit API - Infralligence","og_description":"Use the Selection class to: retrieve pre-selected elements, request user selection, set selected elements programmatically...","og_url":"https:\/\/infralligence.com\/pl\/resources\/selecting-and-picking-elements-in-revit-api\/","og_site_name":"Infralligence","article_published_time":"2024-09-25T08:55:06+00:00","article_modified_time":"2024-12-31T09:29:51+00:00","og_image":[{"width":2653,"height":1493,"url":"https:\/\/infralligence.com\/wp-content\/uploads\/2024\/12\/4450c1d3-83a7-4dc6-a217-820281e6b8af.png","type":"image\/png"}],"author":"Kamil Korus","twitter_card":"summary_large_image","twitter_misc":{"Napisane przez":"Kamil Korus","Szacowany czas czytania":"2 minuty"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/infralligence.com\/resources\/selecting-and-picking-elements-in-revit-api\/#article","isPartOf":{"@id":"https:\/\/infralligence.com\/resources\/selecting-and-picking-elements-in-revit-api\/"},"author":{"name":"Kamil Korus","@id":"https:\/\/infralligence.com\/#\/schema\/person\/838177275b7d3b8b217b13180a74aeda"},"headline":"Selecting and Picking Elements in Revit API","datePublished":"2024-09-25T08:55:06+00:00","dateModified":"2024-12-31T09:29:51+00:00","mainEntityOfPage":{"@id":"https:\/\/infralligence.com\/resources\/selecting-and-picking-elements-in-revit-api\/"},"wordCount":321,"publisher":{"@id":"https:\/\/infralligence.com\/#organization"},"image":{"@id":"https:\/\/infralligence.com\/resources\/selecting-and-picking-elements-in-revit-api\/#primaryimage"},"thumbnailUrl":"https:\/\/infralligence.com\/wp-content\/uploads\/2024\/12\/4450c1d3-83a7-4dc6-a217-820281e6b8af.png","articleSection":["Revit API Basics"],"inLanguage":"pl-PL"},{"@type":"WebPage","@id":"https:\/\/infralligence.com\/resources\/selecting-and-picking-elements-in-revit-api\/","url":"https:\/\/infralligence.com\/resources\/selecting-and-picking-elements-in-revit-api\/","name":"Selecting and Picking Elements in Revit API - Infralligence","isPartOf":{"@id":"https:\/\/infralligence.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/infralligence.com\/resources\/selecting-and-picking-elements-in-revit-api\/#primaryimage"},"image":{"@id":"https:\/\/infralligence.com\/resources\/selecting-and-picking-elements-in-revit-api\/#primaryimage"},"thumbnailUrl":"https:\/\/infralligence.com\/wp-content\/uploads\/2024\/12\/4450c1d3-83a7-4dc6-a217-820281e6b8af.png","datePublished":"2024-09-25T08:55:06+00:00","dateModified":"2024-12-31T09:29:51+00:00","description":"Use the Selection class to: retrieve pre-selected elements, request user selection, set selected elements programmatically...","breadcrumb":{"@id":"https:\/\/infralligence.com\/resources\/selecting-and-picking-elements-in-revit-api\/#breadcrumb"},"inLanguage":"pl-PL","potentialAction":[{"@type":"ReadAction","target":["https:\/\/infralligence.com\/resources\/selecting-and-picking-elements-in-revit-api\/"]}]},{"@type":"ImageObject","inLanguage":"pl-PL","@id":"https:\/\/infralligence.com\/resources\/selecting-and-picking-elements-in-revit-api\/#primaryimage","url":"https:\/\/infralligence.com\/wp-content\/uploads\/2024\/12\/4450c1d3-83a7-4dc6-a217-820281e6b8af.png","contentUrl":"https:\/\/infralligence.com\/wp-content\/uploads\/2024\/12\/4450c1d3-83a7-4dc6-a217-820281e6b8af.png"},{"@type":"BreadcrumbList","@id":"https:\/\/infralligence.com\/resources\/selecting-and-picking-elements-in-revit-api\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/infralligence.com\/"},{"@type":"ListItem","position":2,"name":"Selecting and Picking Elements in Revit API"}]},{"@type":"WebSite","@id":"https:\/\/infralligence.com\/#website","url":"https:\/\/infralligence.com\/","name":"Infralligence","description":"Digital Automation and AI for civil engineering","publisher":{"@id":"https:\/\/infralligence.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/infralligence.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"pl-PL"},{"@type":"Organization","@id":"https:\/\/infralligence.com\/#organization","name":"Infralligence","url":"https:\/\/infralligence.com\/","logo":{"@type":"ImageObject","inLanguage":"pl-PL","@id":"https:\/\/infralligence.com\/#\/schema\/logo\/image\/","url":"https:\/\/infralligence.com\/wp-content\/uploads\/2024\/11\/android-chrome-192x192-1.png","contentUrl":"https:\/\/infralligence.com\/wp-content\/uploads\/2024\/11\/android-chrome-192x192-1.png","width":192,"height":192,"caption":"Infralligence"},"image":{"@id":"https:\/\/infralligence.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/infralligence.com\/#\/schema\/person\/838177275b7d3b8b217b13180a74aeda","name":"Kamil Korus","image":{"@type":"ImageObject","inLanguage":"pl-PL","@id":"https:\/\/infralligence.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/95bd7da2ac29ff34a2ab9bf4ea30273b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/95bd7da2ac29ff34a2ab9bf4ea30273b?s=96&d=mm&r=g","caption":"Kamil Korus"},"sameAs":["https:\/\/www.linkedin.com\/in\/kamil-korus\/"],"url":"https:\/\/infralligence.com\/pl\/resources\/author\/kamil-korus\/"}]}},"_links":{"self":[{"href":"https:\/\/infralligence.com\/pl\/wp-json\/wp\/v2\/posts\/2752","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/infralligence.com\/pl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/infralligence.com\/pl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/infralligence.com\/pl\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/infralligence.com\/pl\/wp-json\/wp\/v2\/comments?post=2752"}],"version-history":[{"count":7,"href":"https:\/\/infralligence.com\/pl\/wp-json\/wp\/v2\/posts\/2752\/revisions"}],"predecessor-version":[{"id":2761,"href":"https:\/\/infralligence.com\/pl\/wp-json\/wp\/v2\/posts\/2752\/revisions\/2761"}],"wp:attachment":[{"href":"https:\/\/infralligence.com\/pl\/wp-json\/wp\/v2\/media?parent=2752"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/infralligence.com\/pl\/wp-json\/wp\/v2\/categories?post=2752"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/infralligence.com\/pl\/wp-json\/wp\/v2\/tags?post=2752"},{"taxonomy":"post_folder","embeddable":true,"href":"https:\/\/infralligence.com\/pl\/wp-json\/wp\/v2\/post_folder?post=2752"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}