<?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: ErroThere is no argument given that corresponds to the required formal param in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/errothere-is-no-argument-given-that-corresponds-to-the-required/m-p/7351912#M56506</link>
    <description>&lt;P&gt;Hi @Anonymous,&lt;/P&gt;
&lt;P&gt;I'm glad you are making progress.&lt;/P&gt;
&lt;P&gt;You are asking whether a GeometryElement&amp;nbsp;object&amp;nbsp;is equal to the &lt;EM&gt;type&lt;/EM&gt; 'Arc'. You're trying to compare an instance of an object to a definition of an object (in simplistic terms).&lt;/P&gt;
&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;If (geomElem Is Arc)
{
....&lt;/PRE&gt;
&lt;P&gt;If that still gives you grief, specify the full namespace for 'Arc'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 04 Sep 2017 08:38:10 GMT</pubDate>
    <dc:creator>matthew_taylor</dc:creator>
    <dc:date>2017-09-04T08:38:10Z</dc:date>
    <item>
      <title>ErroThere is no argument given that corresponds to the required formal parameter</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/errothere-is-no-argument-given-that-corresponds-to-the-required/m-p/7327785#M56503</link>
      <description>&lt;P&gt;Hi guys,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I am very close to finishing a plugin I have been working on except for one error message.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Error CS7036 There is no argument given that corresponds to the required formal parameter 'hostDoor' of 'FamilyInstanceExtensions.GetOptimalTagLocation(Wall, FamilyInstance, GeometryElement, XYZ)' DoorTagProject C:\Users\dobbs\Desktop\test - Copy\DoorTagProject\DoorTagProject\DoorTag\IndependentTagExtensions.cs 33 Active&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The class it is referring to is here&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;using Autodesk.Revit.DB;
using DoorTag;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DoorTag
{
    public static class IndependentTagExtensions 
     {
        // check if the doortag is attached to a valid door 
        public static bool IsAttachedToValidDoor(this IndependentTag tag, bool IsValidDoor)
        {
            // call the GetTaggedLocalElement method to get the host Door
            var hostDoor = (FamilyInstance)tag.GetTaggedLocalElement();
            if (hostDoor == null)
            {
                return false;
            }
            // if there is a door, call the IsValidDoor method to check if it is a valid door
            bool IsAttachedToValidDoor = IsValidDoor;

            return IsAttachedToValidDoor;
        }
               

        // move the tag to the right position 
        public static void MoveToCorrectPosition(this IndependentTag tag, FamilyInstance hostDoor, Wall hostWall)
        {
            // Find the optimal location for the door tag to be placed based on the hostDoor
            XYZ newPlace = hostWall.GetOptimalTagLocation();

            // find the tags old place as a location point
            LocationPoint tagLocationPoint = tag.Location as LocationPoint;

            //convert that to a XYZ value 
            XYZ oldPlace = tagLocationPoint.Point;

            // create a vector between old and new
            XYZ vectorFromOldToNew = newPlace - oldPlace;

            // Place the tag at the new place
            ElementTransformUtils.MoveElement(tag.Document, tag.Id, vectorFromOldToNew);
        }

        // Get tag location point 
        public static Autodesk.Revit.DB.LocationPoint GetTagLocationPoint(this IndependentTag tag)
        {
            // Get the tah location point as a locationpoint not a XYZ - you can convert this later. 
            LocationPoint thetagLocationPoint = tag.Location as LocationPoint;
            return thetagLocationPoint;
        }
    }
}&lt;/PRE&gt;&lt;P&gt;Does anyone know why this is happening?&amp;nbsp;&lt;/P&gt;&lt;P&gt;I made a technology architecture drawing to help explain how I am passing parameters.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JPEG_20170823_174159_1738679980[5257][5260].jpg" style="width: 529px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/394061i843F62253826969C/image-size/large?v=v2&amp;amp;px=999" role="button" title="JPEG_20170823_174159_1738679980[5257][5260].jpg" alt="JPEG_20170823_174159_1738679980[5257][5260].jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached my project as well just in case that wasn't enough information&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2017 04:13:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/errothere-is-no-argument-given-that-corresponds-to-the-required/m-p/7327785#M56503</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-08-25T04:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: ErroThere is no argument given that corresponds to the required formal param</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/errothere-is-no-argument-given-that-corresponds-to-the-required/m-p/7328752#M56504</link>
      <description>&lt;P&gt;Hi @Anonymous,&lt;/P&gt;
&lt;P&gt;The extension that is causing an issue has the signature:&lt;/P&gt;
&lt;PRE&gt;public static XYZ GetOptimalTagLocation(this FamilyInstanceExtensions hostDoor)&lt;/PRE&gt;
&lt;P&gt;So, you're passing in FamilyInstanceExtensions presumably instead&amp;nbsp;of FamilyInstance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's not the only problem though, as doorSwingArc is not declared, and the passed in value of hostDoor is not used at all.&lt;/P&gt;
&lt;P&gt;Also, you're trying to create a new point with OptimalTagLocationPoint, but you need to use new XYZ(....).&lt;/P&gt;
&lt;P&gt;Also, you refer to wallOffSetPoint, though it is not declared.&lt;/P&gt;
&lt;P&gt;BUT, you're also using a familyInstance extension (GetOptimalTagLocation) with a Wall. A Wall instance&amp;nbsp;cannot be a FamilyInstance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, a fair few issues. I didn't delve further.&amp;nbsp;Most of these issues should be picked up by the IDE. If you're private or in a small company, you'd do well to use something like Visual Studio Community Edition &lt;A href="https://www.visualstudio.com/vs/community/" target="_blank"&gt;https://www.visualstudio.com/vs/community/&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2017 12:42:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/errothere-is-no-argument-given-that-corresponds-to-the-required/m-p/7328752#M56504</guid>
      <dc:creator>matthew_taylor</dc:creator>
      <dc:date>2017-08-25T12:42:50Z</dc:date>
    </item>
    <item>
      <title>Re: ErroThere is no argument given that corresponds to the required formal param</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/errothere-is-no-argument-given-that-corresponds-to-the-required/m-p/7341260#M56505</link>
      <description>&lt;P&gt;I went through and followed the problem like you suggested and ironed out a lot of the problems (there were a lot!).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There was just one last problem that I cannot get.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My geometry test for an 'Arc' is not working (where I test if a geometry in a list of geometries is an Arc. see below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Autodesk.Revit.DB.Architecture;
using Autodesk.Revit.UI.Selection;
using Autodesk.Revit.ApplicationServices;
using DoorTag;

namespace DoorTag
{
    internal static class DoorArcExtensions
    {
        // get list of doorSwingarcs
        public static List&amp;lt;GeometryElement&amp;gt; GetListOfDoorArcs(this IndependentTag tag)
        {
            FamilyInstance door = IndependentTagExtensions.GetTaggedLocalElement(tag);
            // have some options 
            Autodesk.Revit.DB.Options opt = new Options();

            // Create a new empty list of arcs
            List&amp;lt;GeometryElement&amp;gt; ListOfDoorArcs = new List&amp;lt;GeometryElement&amp;gt;();

            // Get the list of the geometry objects 
            Autodesk.Revit.DB.GeometryElement geomElem = door.get_Geometry(opt);

            // for each geometry element that is an arc, add that to the list of door arcs
            foreach (GeometryElement geomObj in geomElem)
            {

                if (geomElem == Arc)
                {
                    ListOfDoorArcs.Add(geomElem);
                }

                List&amp;lt;GeometryElement&amp;gt; tempList = ListOfDoorArcs;

                GeometryElement doorArc = tempList[0];

                
            }
            return ListOfDoorArcs;
        }

        // get list of doorSwingarcs
        public static GeometryElement GetDoorArc(this IndependentTag tag)
        {
            FamilyInstance door = IndependentTagExtensions.GetTaggedLocalElement(tag);
            List&amp;lt;GeometryElement&amp;gt; tempList = DoorArcExtensions.GetListOfDoorArcs(tag);
            GeometryElement doorArc = tempList[0];
                // count the number of items in the list
                int countOfDoorArcs = tempList.Count;
                if (countOfDoorArcs &amp;lt;= 1)
                {
                    if (countOfDoorArcs == 0) // it must be a sliding door or panel
                    {
                        doorArc = tempList[0]; // do nothing 
                    }
                    else // it must be a single door
                    {
                        doorArc = tempList[0];
                    }
                    return doorArc;
                }
                // Test for double or leaf and a half
                else
                {
                     
                    doorArc = tempList[0];

                }
            return doorArc;
        }
    }
}

            &lt;/PRE&gt;&lt;P&gt;The error I am getting is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"Arc is a type which is not valid in the current context". do I need to invoke an initialization class that lets me access Revit&amp;nbsp;geometry types?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any thoughts are always appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 07:32:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/errothere-is-no-argument-given-that-corresponds-to-the-required/m-p/7341260#M56505</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-08-31T07:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: ErroThere is no argument given that corresponds to the required formal param</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/errothere-is-no-argument-given-that-corresponds-to-the-required/m-p/7351912#M56506</link>
      <description>&lt;P&gt;Hi @Anonymous,&lt;/P&gt;
&lt;P&gt;I'm glad you are making progress.&lt;/P&gt;
&lt;P&gt;You are asking whether a GeometryElement&amp;nbsp;object&amp;nbsp;is equal to the &lt;EM&gt;type&lt;/EM&gt; 'Arc'. You're trying to compare an instance of an object to a definition of an object (in simplistic terms).&lt;/P&gt;
&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;If (geomElem Is Arc)
{
....&lt;/PRE&gt;
&lt;P&gt;If that still gives you grief, specify the full namespace for 'Arc'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Sep 2017 08:38:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/errothere-is-no-argument-given-that-corresponds-to-the-required/m-p/7351912#M56506</guid>
      <dc:creator>matthew_taylor</dc:creator>
      <dc:date>2017-09-04T08:38:10Z</dc:date>
    </item>
  </channel>
</rss>

