<?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 Betreff: Replace Name Layout With Drawing Name in in Documentation</title>
    <link>https://community.graphisoft.com/t5/Documentation/Replace-Name-Layout-With-Drawing-Name-in/m-p/657580#M67846</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/13209"&gt;@cagarruta&lt;/a&gt;&amp;nbsp; schrieb:&lt;BR /&gt;
&lt;P&gt;I have a lot of layouts with PDF inserted.&lt;/P&gt;
&lt;P&gt;Is there any way to replace the name of the layout with the hosted single name drawing (PDF) in?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That's possible with Python.&lt;/P&gt;
&lt;P&gt;The following script will rename all Layouts in a given folder (change it before running obviously) to their first placed drawing.&lt;BR /&gt;Caveat: It is currently impossible to tell what kind of drawing is placed on a layout! So this will cover internal drawings just &lt;EM&gt;as well&lt;/EM&gt; as external PDFs.&lt;/P&gt;
&lt;P&gt;That's why it's needed to restrict this to a given folder. It's also undoable. So please beware.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;import archicad

try:
	conn = archicad.ACConnection.connect()
	assert conn

	acc = conn.commands
	act = conn.types
	acu = conn.utilities

except AssertionError:
	raise RuntimeError("No Archicad instance running!")


subset_name = "MY FOLDERNAME"
# rename :	  ^^^^^^^^^^^^
# *****************************#

layoutBookTree = acc.GetNavigatorItemTree(act.NavigatorTreeId("LayoutBook"))

# get the approppiate Folder:
subset_itemList = acu.FindInNavigatorItemTree(
	layoutBookTree.rootItem, lambda node: node.name == subset_name
)

# The following gives not the subset as-is, but instead a list of
# discrete 'NavigatorItemArrayItem's (sic)...
for item in subset_itemList[0].children:
	# is a Drawing placed?
	if item.navigatorItem.children is not None:
		acc.RenameNavigatorItem(
			item.navigatorItem.navigatorItemId,
			item.navigatorItem.children[0].navigatorItem.name,
		)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 30 Mar 2025 12:53:53 GMT</pubDate>
    <dc:creator>runxel</dc:creator>
    <dc:date>2025-03-30T12:53:53Z</dc:date>
    <item>
      <title>Replace Name Layout With Drawing Name in</title>
      <link>https://community.graphisoft.com/t5/Documentation/Replace-Name-Layout-With-Drawing-Name-in/m-p/657506#M67839</link>
      <description>&lt;P&gt;Hi to all!&lt;/P&gt;
&lt;P&gt;I have a lot of layouts with PDF inserted.&lt;/P&gt;
&lt;P&gt;Is there any way to replace the name of the layout with the hosted single name drawing (PDF) in?&lt;/P&gt;
&lt;P&gt;Attached image to explain it&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="get drawing name and paste to layout name.png" style="width: 999px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/85313i8DA6E8E16210FD51/image-size/large?v=v2&amp;amp;px=999" role="button" title="get drawing name and paste to layout name.png" alt="get drawing name and paste to layout name.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advanced.&lt;/P&gt;
&lt;P&gt;JCG&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" color="grey"&gt;Operating system used: &lt;EM&gt;Windows 24H2&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Mar 2025 13:17:40 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Documentation/Replace-Name-Layout-With-Drawing-Name-in/m-p/657506#M67839</guid>
      <dc:creator>cagarruta</dc:creator>
      <dc:date>2025-03-29T13:17:40Z</dc:date>
    </item>
    <item>
      <title>Betreff: Replace Name Layout With Drawing Name in</title>
      <link>https://community.graphisoft.com/t5/Documentation/Replace-Name-Layout-With-Drawing-Name-in/m-p/657580#M67846</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/13209"&gt;@cagarruta&lt;/a&gt;&amp;nbsp; schrieb:&lt;BR /&gt;
&lt;P&gt;I have a lot of layouts with PDF inserted.&lt;/P&gt;
&lt;P&gt;Is there any way to replace the name of the layout with the hosted single name drawing (PDF) in?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That's possible with Python.&lt;/P&gt;
&lt;P&gt;The following script will rename all Layouts in a given folder (change it before running obviously) to their first placed drawing.&lt;BR /&gt;Caveat: It is currently impossible to tell what kind of drawing is placed on a layout! So this will cover internal drawings just &lt;EM&gt;as well&lt;/EM&gt; as external PDFs.&lt;/P&gt;
&lt;P&gt;That's why it's needed to restrict this to a given folder. It's also undoable. So please beware.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;import archicad

try:
	conn = archicad.ACConnection.connect()
	assert conn

	acc = conn.commands
	act = conn.types
	acu = conn.utilities

except AssertionError:
	raise RuntimeError("No Archicad instance running!")


subset_name = "MY FOLDERNAME"
# rename :	  ^^^^^^^^^^^^
# *****************************#

layoutBookTree = acc.GetNavigatorItemTree(act.NavigatorTreeId("LayoutBook"))

# get the approppiate Folder:
subset_itemList = acu.FindInNavigatorItemTree(
	layoutBookTree.rootItem, lambda node: node.name == subset_name
)

# The following gives not the subset as-is, but instead a list of
# discrete 'NavigatorItemArrayItem's (sic)...
for item in subset_itemList[0].children:
	# is a Drawing placed?
	if item.navigatorItem.children is not None:
		acc.RenameNavigatorItem(
			item.navigatorItem.navigatorItemId,
			item.navigatorItem.children[0].navigatorItem.name,
		)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 30 Mar 2025 12:53:53 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Documentation/Replace-Name-Layout-With-Drawing-Name-in/m-p/657580#M67846</guid>
      <dc:creator>runxel</dc:creator>
      <dc:date>2025-03-30T12:53:53Z</dc:date>
    </item>
    <item>
      <title>Betreff: Replace Name Layout With Drawing Name in</title>
      <link>https://community.graphisoft.com/t5/Documentation/Replace-Name-Layout-With-Drawing-Name-in/m-p/657586#M67847</link>
      <description>&lt;P&gt;Thanks so much, Runxel.&lt;BR /&gt;I've been meaning to learn Python to use with Archicad, and I think the time has come.&lt;/P&gt;</description>
      <pubDate>Sun, 30 Mar 2025 18:06:30 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Documentation/Replace-Name-Layout-With-Drawing-Name-in/m-p/657586#M67847</guid>
      <dc:creator>cagarruta</dc:creator>
      <dc:date>2025-03-30T18:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: Replace Name Layout With Drawing Name in</title>
      <link>https://community.graphisoft.com/t5/Documentation/Replace-Name-Layout-With-Drawing-Name-in/m-p/657589#M67848</link>
      <description>&lt;P&gt;Awesome Runxel!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;it works at first time!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks a lot!&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="cagarruta_0-1743360215002.png" style="width: 800px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/85329i1A20567190C2F24A/image-dimensions/800x685?v=v2" width="800" height="685" role="button" title="cagarruta_0-1743360215002.png" alt="cagarruta_0-1743360215002.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Apr 2025 00:25:14 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Documentation/Replace-Name-Layout-With-Drawing-Name-in/m-p/657589#M67848</guid>
      <dc:creator>cagarruta</dc:creator>
      <dc:date>2025-04-01T00:25:14Z</dc:date>
    </item>
  </channel>
</rss>

