<?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>idea Revit API FamilySymbol can be actually renamed as duplicated name Bug? en Revit Ideas</title>
    <link>https://forums.autodesk.com/t5/revit-ideas/revit-api-familysymbol-can-be-actually-renamed-as-duplicated/idi-p/12718821</link>
    <description>&lt;P&gt;&lt;STRONG&gt;Phenomenon&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've found out that&amp;nbsp;Autodesk.Revit.Exceptions.ArgumentException is not thrown when trying to rename FamlySymbol.Name, so that familysymbols can be able to own duplicated name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code :&lt;/P&gt;&lt;LI-CODE lang="general"&gt;[Transaction(TransactionMode.Manual)]
    public class FamilyDuplicate : IExternalCommand
    {
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            //Boilerplate Variables
            var uiapp = commandData.Application;
            var app = uiapp.Application;
            var uidoc = uiapp.ActiveUIDocument;
            var doc = uidoc.Document;

            var currentSelection = uidoc.Selection;

//First, I caught this when I tried renaming of FamilySymbol. But it also occured when the target instance is parent class.
            var symbol = doc.GetElement(currentSelection.GetElementIds().First());

            try
            {
                using (var tr = new Transaction(doc, "Rename Duplication Test"))
                {
                    tr.Start();
                    symbol.Name = "300x300";
                    tr.Commit();
                }
            }
            catch (Exception ex)
            {
                TaskDialog.Show("Rename Error", ex.Message);
                return Result.Failed;
            }

            return Result.Succeeded;
        }
    }&lt;/LI-CODE&gt;&lt;P&gt;&lt;div class="lia-vid-container video-embed-center"&gt;&lt;div id="lia-vid-6351198842112w694h540r382" class="lia-video-brightcove-player-container"&gt;&lt;video-js data-video-id="6351198842112" data-account="6057940548001" data-player="default" data-embed="default" class="vjs-fluid" controls="" data-application-id="" style="width: 100%; height: 100%;"&gt;&lt;/video-js&gt;&lt;/div&gt;&lt;script src="https://players.brightcove.net/6057940548001/default_default/index.min.js"&gt;&lt;/script&gt;&lt;a class="video-embed-link" href="https://forums.autodesk.com/t5/video/gallerypage/video-id/6351198842112"&gt;(ver en Mis vídeos)&lt;/a&gt;&lt;/div&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Product : Revit 2024's API&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;GUESS&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've found that the inherited property from ElementType class has no Exception catching rule.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="itsjakk3_0-1713487628750.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1351843i7EE94DF111A6E1B2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="itsjakk3_0-1713487628750.png" alt="itsjakk3_0-1713487628750.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the parent class of this (Element) has exception throw rule.&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="itsjakk3_1-1713487786057.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1351845i28841F6ED80F40F6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="itsjakk3_1-1713487786057.png" alt="itsjakk3_1-1713487786057.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I tried the renaming of Element instance, it was same with familysymbol, no exception thrown.&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Suggestion&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;It would be better when renaming via API, the exception occurs for prevent of creating duplicated name of familysymbol if the add-in creates new familysymbol.&lt;/P&gt;</description>
    <pubDate>Fri, 19 Apr 2024 00:59:29 GMT</pubDate>
    <dc:creator>itsjakk3</dc:creator>
    <dc:date>2024-04-19T00:59:29Z</dc:date>
    <item>
      <title>Revit API FamilySymbol can be actually renamed as duplicated name Bug?</title>
      <link>https://forums.autodesk.com/t5/revit-ideas/revit-api-familysymbol-can-be-actually-renamed-as-duplicated/idi-p/12718821</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Phenomenon&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've found out that&amp;nbsp;Autodesk.Revit.Exceptions.ArgumentException is not thrown when trying to rename FamlySymbol.Name, so that familysymbols can be able to own duplicated name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code :&lt;/P&gt;&lt;LI-CODE lang="general"&gt;[Transaction(TransactionMode.Manual)]
    public class FamilyDuplicate : IExternalCommand
    {
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            //Boilerplate Variables
            var uiapp = commandData.Application;
            var app = uiapp.Application;
            var uidoc = uiapp.ActiveUIDocument;
            var doc = uidoc.Document;

            var currentSelection = uidoc.Selection;

//First, I caught this when I tried renaming of FamilySymbol. But it also occured when the target instance is parent class.
            var symbol = doc.GetElement(currentSelection.GetElementIds().First());

            try
            {
                using (var tr = new Transaction(doc, "Rename Duplication Test"))
                {
                    tr.Start();
                    symbol.Name = "300x300";
                    tr.Commit();
                }
            }
            catch (Exception ex)
            {
                TaskDialog.Show("Rename Error", ex.Message);
                return Result.Failed;
            }

            return Result.Succeeded;
        }
    }&lt;/LI-CODE&gt;&lt;P&gt;&lt;div class="lia-vid-container video-embed-center"&gt;&lt;div id="lia-vid-6351198842112w694h540r28" class="lia-video-brightcove-player-container"&gt;&lt;video-js data-video-id="6351198842112" data-account="6057940548001" data-player="default" data-embed="default" class="vjs-fluid" controls="" data-application-id="" style="width: 100%; height: 100%;"&gt;&lt;/video-js&gt;&lt;/div&gt;&lt;script src="https://players.brightcove.net/6057940548001/default_default/index.min.js"&gt;&lt;/script&gt;&lt;a class="video-embed-link" href="https://forums.autodesk.com/t5/video/gallerypage/video-id/6351198842112"&gt;(ver en Mis vídeos)&lt;/a&gt;&lt;/div&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Product : Revit 2024's API&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;GUESS&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've found that the inherited property from ElementType class has no Exception catching rule.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="itsjakk3_0-1713487628750.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1351843i7EE94DF111A6E1B2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="itsjakk3_0-1713487628750.png" alt="itsjakk3_0-1713487628750.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the parent class of this (Element) has exception throw rule.&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="itsjakk3_1-1713487786057.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1351845i28841F6ED80F40F6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="itsjakk3_1-1713487786057.png" alt="itsjakk3_1-1713487786057.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I tried the renaming of Element instance, it was same with familysymbol, no exception thrown.&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Suggestion&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;It would be better when renaming via API, the exception occurs for prevent of creating duplicated name of familysymbol if the add-in creates new familysymbol.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2024 00:59:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-ideas/revit-api-familysymbol-can-be-actually-renamed-as-duplicated/idi-p/12718821</guid>
      <dc:creator>itsjakk3</dc:creator>
      <dc:date>2024-04-19T00:59:29Z</dc:date>
    </item>
  </channel>
</rss>

