<?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: Find unused viewpoints from Project Map? in Archicad Python API</title>
    <link>https://community.graphisoft.com/t5/Archicad-Python-API/Find-unused-viewpoints-from-Project-Map/m-p/616318#M1032</link>
    <description>&lt;P&gt;Thanks, but unfortunately no, this program is similar to the Python script from GS to identify unused views. What I'm looking for is &lt;EM&gt;viewpoints&amp;nbsp;&lt;/EM&gt;in the &lt;EM&gt;Project Map&lt;/EM&gt;, ones that have no views created from.&lt;/P&gt;</description>
    <pubDate>Thu, 18 Jul 2024 07:19:48 GMT</pubDate>
    <dc:creator>MinhNguyen</dc:creator>
    <dc:date>2024-07-18T07:19:48Z</dc:date>
    <item>
      <title>Find unused viewpoints from Project Map?</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Find-unused-viewpoints-from-Project-Map/m-p/616303#M1028</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;
&lt;P&gt;I'm wondering if it's possible to find &lt;EM&gt;unused viewpoints&lt;/EM&gt; from the &lt;EM&gt;Project Map&lt;/EM&gt;? From GS there was a script for unused views (ones that are not placed in layouts or publisher set), my idea is to make a script that renames all unused viewpoints - one that has no view created. Does anyone have some idea on this? Any suggestion is greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2024 05:20:26 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Find-unused-viewpoints-from-Project-Map/m-p/616303#M1028</guid>
      <dc:creator>MinhNguyen</dc:creator>
      <dc:date>2024-07-18T05:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: Find unused viewpoints from Project Map?</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Find-unused-viewpoints-from-Project-Map/m-p/616304#M1029</link>
      <description>&lt;P&gt;Yes, it is possible with python script. Script needs to check if view is created from viewpoint.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2024 05:35:30 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Find-unused-viewpoints-from-Project-Map/m-p/616304#M1029</guid>
      <dc:creator>Piotr Walerysiak</dc:creator>
      <dc:date>2024-07-18T05:35:30Z</dc:date>
    </item>
    <item>
      <title>Re: Find unused viewpoints from Project Map?</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Find-unused-viewpoints-from-Project-Map/m-p/616305#M1030</link>
      <description>&lt;P&gt;Is it possible for you to share some snippets of how you would do it? I followed the example script of moving unused views into a folder and successfully modified it into renaming unused views. Now I would like to apply the same logic for the viewpoints, but looks like it's not as easy as changing some parameters&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2024 05:40:04 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Find-unused-viewpoints-from-Project-Map/m-p/616305#M1030</guid>
      <dc:creator>MinhNguyen</dc:creator>
      <dc:date>2024-07-18T05:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: Find unused viewpoints from Project Map?</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Find-unused-viewpoints-from-Project-Map/m-p/616317#M1031</link>
      <description>&lt;P&gt;Are you talking about this function:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://bimdots.com/product/unused-view-cleaner/" target="_blank"&gt;https://bimdots.com/product/unused-view-cleaner/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2024 07:17:12 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Find-unused-viewpoints-from-Project-Map/m-p/616317#M1031</guid>
      <dc:creator>Botonis</dc:creator>
      <dc:date>2024-07-18T07:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: Find unused viewpoints from Project Map?</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Find-unused-viewpoints-from-Project-Map/m-p/616318#M1032</link>
      <description>&lt;P&gt;Thanks, but unfortunately no, this program is similar to the Python script from GS to identify unused views. What I'm looking for is &lt;EM&gt;viewpoints&amp;nbsp;&lt;/EM&gt;in the &lt;EM&gt;Project Map&lt;/EM&gt;, ones that have no views created from.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2024 07:19:48 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Find-unused-viewpoints-from-Project-Map/m-p/616318#M1032</guid>
      <dc:creator>MinhNguyen</dc:creator>
      <dc:date>2024-07-18T07:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: Find unused viewpoints from Project Map?</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Find-unused-viewpoints-from-Project-Map/m-p/616319#M1033</link>
      <description>&lt;P&gt;Ok..... That might be usefull also.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2024 07:22:24 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Find-unused-viewpoints-from-Project-Map/m-p/616319#M1033</guid>
      <dc:creator>Botonis</dc:creator>
      <dc:date>2024-07-18T07:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: Find unused viewpoints from Project Map?</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Find-unused-viewpoints-from-Project-Map/m-p/616320#M1034</link>
      <description>&lt;P&gt;This is the code I created for this purpose few years ago. I'm completely amateur in python, but it works for me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from archicad import ACConnection

conn = ACConnection.connect()
assert conn

acc = conn.commands
act = conn.types
acu = conn.utilities



######## UnusedProjectMapItemsList ########

def isLinkNavigatorItem(item : act.NavigatorItem):
    return item.sourceNavigatorItemId is not None


viewMapTree = acc.GetNavigatorItemTree(act.NavigatorTreeId('ViewMap'))
links = acu.FindInNavigatorItemTree(viewMapTree.rootItem, isLinkNavigatorItem)


sourcesOfLinks = set(link.sourceNavigatorItemId.guid for link in links)

projectMapTree = acc.GetNavigatorItemTree(act.NavigatorTreeId('ProjectMap'))

unusedProjectMapItems = acu.FindInNavigatorItemTree(projectMapTree.rootItem, lambda i: i.navigatorItemId.guid not in sourcesOfLinks )
unusedProjectMapItemsFiltered = []
for ii in unusedProjectMapItems:
    isChildOfUnused = False
    for jj in unusedProjectMapItems:
        if ii != jj and acu.FindInNavigatorItemTree(jj, lambda node: node.navigatorItemId.guid == ii.navigatorItemId.guid):
           isChildOfUnused = True
           break
    if not isChildOfUnused:
        unusedProjectMapItemsFiltered.append(ii)


import datetime
JRAtime = datetime.datetime.now()
JRAtimestr = JRAtime.strftime("%Y")+"/"+ JRAtime.strftime("%m")+"/"+JRAtime.strftime("%d")+" "+ JRAtime.strftime("%X") 

unusedProjectMapItemsCounter = 0

print('----- Unused Project Map Items List Start -----')
print('------------- ' + JRAtimestr+ ' -------------')


for unusedViewTreeItem in unusedProjectMapItems:

        if unusedViewTreeItem.type == "UndefinedItem":
            print( "\n" + unusedViewTreeItem.prefix +" "+ unusedViewTreeItem.name)
        else:
            print( "\t" + unusedViewTreeItem.prefix +" "+ unusedViewTreeItem.name)
            unusedProjectMapItemsCounter += 1
            
print(f'')
print("----- Unused Project Map Items Counter:", unusedProjectMapItemsCounter, "-----")
print('------------------- List End --------------------')
print('-------------- ' + JRAtimestr+ ' --------------')

print(f'')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2024 07:31:05 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Find-unused-viewpoints-from-Project-Map/m-p/616320#M1034</guid>
      <dc:creator>Piotr Walerysiak</dc:creator>
      <dc:date>2024-07-18T07:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: Find unused viewpoints from Project Map?</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Find-unused-viewpoints-from-Project-Map/m-p/616321#M1035</link>
      <description>&lt;P&gt;Wow, thank you so much! Worked like a charm for me! I think I know why mine doesn't work, I could use some idea in here for my project.&lt;/P&gt;
&lt;P&gt;Thank you once again for the big help, much appreciated!&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2024 07:37:09 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Find-unused-viewpoints-from-Project-Map/m-p/616321#M1035</guid>
      <dc:creator>MinhNguyen</dc:creator>
      <dc:date>2024-07-18T07:37:09Z</dc:date>
    </item>
  </channel>
</rss>

