<?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: Forward Migration Script &amp;amp; Favourites in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/Forward-Migration-Script-amp-Favourites/m-p/579494#M6014</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;favorites and not yet placed element can be distinguished by their GLOB_INTGUID, which is either "" or "{00000000-0000-0000-0000-000000000000}".&lt;/P&gt;
&lt;P&gt;However I am not sure it works in fwm script for placed objects.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Dec 2023 14:07:03 GMT</pubDate>
    <dc:creator>Peter Baksa</dc:creator>
    <dc:date>2023-12-08T14:07:03Z</dc:date>
    <item>
      <title>Forward Migration Script &amp; Favourites</title>
      <link>https://community.graphisoft.com/t5/GDL/Forward-Migration-Script-amp-Favourites/m-p/577196#M5906</link>
      <description>&lt;P&gt;So I have made some modifications to some objects used across our office.&lt;/P&gt;
&lt;P&gt;I have used the forward migration&amp;nbsp; to migrate the object to the newer version with a new guid and to trigger a param to be turned on to allow a legacy part of the code to remain running, so as not to unintentionally break instances of the object that have already been placed in projects.&lt;/P&gt;
&lt;P&gt;Below is a copy of the migration script I am using&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The issue I have is that this then turns that parameter on in favourites saved within our template that utilise this object - which I don't want.&amp;nbsp; And to reverse this I would have to open up every project that was created with that template and manually modify the favourite.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way to identify when the migration script is being run on a Favourites, so I can skip that part of the code?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Scott&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;actualGUID = FROM_GUID

! ==============================================================================
! Subroutines
! ==============================================================================

_startID    = "2913993A-47ED-4789-9C9F-98EBB2D2315E"  !! FTA Generic Label_23
_endID      = "767AAD6E-D907-4DA2-84E5-165B3F42C5E2"
gosub "migrationstepname_FWM_FTA Generic Label_23"

setmigrationguid actualGUID


end !!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!


!!! migrationstepname
"migrationstepname_FWM_FTA Generic Label_23":
    if actualGuid = _startID then

        parameters cut_fill_legacy = 1  ! maintain reading of the cut fill on objects for older jobs  

        actualGuid = _endID
    endif
return

&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2024 11:32:52 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Forward-Migration-Script-amp-Favourites/m-p/577196#M5906</guid>
      <dc:creator>scottjm</dc:creator>
      <dc:date>2024-09-26T11:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: Forward Migration Script &amp; Favourites</title>
      <link>https://community.graphisoft.com/t5/GDL/Forward-Migration-Script-amp-Favourites/m-p/577231#M5910</link>
      <description>&lt;P&gt;I have done a similar thing, a boolean parameter in my migrated objects to say it has been migrated, and will continue using the old code until that boolean is turned off.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But in answer to your question, all favourites saved before the migration of the objects do not have that parameter.&lt;/P&gt;
&lt;P&gt;When the object is migrated, the favourite will also use the migration script to update the object used, and so will set that migration boolean to be on.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not much you can do about it, except as you noted, update your favourites.&lt;/P&gt;
&lt;P&gt;I have not found a way to determine the object is being place by a favourite.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The kind of good news is, you don't need to edit each favourite one by one in every file you open.&lt;/P&gt;
&lt;P&gt;You have to do it once, in your template (or any other file).&lt;/P&gt;
&lt;P&gt;Then you can import the favourites on-masse or just the ones you want from that template file.&lt;/P&gt;
&lt;P&gt;Probably good to import all favourites from your template so you know you have the latest favourites in your files.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Barry.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2023 02:15:07 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Forward-Migration-Script-amp-Favourites/m-p/577231#M5910</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2023-11-24T02:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: Forward Migration Script &amp; Favourites</title>
      <link>https://community.graphisoft.com/t5/GDL/Forward-Migration-Script-amp-Favourites/m-p/577412#M5917</link>
      <description>&lt;P&gt;The only thing somewhat related to favorites is &lt;SPAN&gt;GLOB_PREVIEW_MODE&lt;/SPAN&gt; (with value = 3), but I doubt it will help in this case...&lt;/P&gt;
&lt;P&gt;You might try, tho. ¯\_(ツ)_/¯&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2023 23:16:08 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Forward-Migration-Script-amp-Favourites/m-p/577412#M5917</guid>
      <dc:creator>runxel</dc:creator>
      <dc:date>2023-11-24T23:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: Forward Migration Script &amp; Favourites</title>
      <link>https://community.graphisoft.com/t5/GDL/Forward-Migration-Script-amp-Favourites/m-p/577525#M5919</link>
      <description>&lt;P&gt;Thanks for your responses guys.&amp;nbsp; That's what I suspected.&amp;nbsp; I considered the GLOB_PREVIEW_MODE, maybe I can hack something to remove those param flags when the object is placed using that.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Nov 2023 22:51:30 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Forward-Migration-Script-amp-Favourites/m-p/577525#M5919</guid>
      <dc:creator>scottjm</dc:creator>
      <dc:date>2023-11-26T22:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: Forward Migration Script &amp; Favourites</title>
      <link>https://community.graphisoft.com/t5/GDL/Forward-Migration-Script-amp-Favourites/m-p/579494#M6014</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;favorites and not yet placed element can be distinguished by their GLOB_INTGUID, which is either "" or "{00000000-0000-0000-0000-000000000000}".&lt;/P&gt;
&lt;P&gt;However I am not sure it works in fwm script for placed objects.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2023 14:07:03 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Forward-Migration-Script-amp-Favourites/m-p/579494#M6014</guid>
      <dc:creator>Peter Baksa</dc:creator>
      <dc:date>2023-12-08T14:07:03Z</dc:date>
    </item>
    <item>
      <title>Re: Forward Migration Script &amp; Favourites</title>
      <link>https://community.graphisoft.com/t5/GDL/Forward-Migration-Script-amp-Favourites/m-p/579681#M6037</link>
      <description>&lt;P&gt;Thanks so much Peter, that is exactly what I needed.&amp;nbsp; That works perfectly. &lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I add this line to my forward migration script:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;if GLOB_INTGUID = "" then
	parameters cut_fill_legacy = 0
endif&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So my full migration script looks like this now:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;actualGUID = FROM_GUID

! ==============================================================================
! Subroutines
! ==============================================================================

_startID    = "2913993A-47ED-4789-9C9F-98EBB2D2315E"  !! FTA Generic Label_23
_endID      = "767AAD6E-D907-4DA2-84E5-165B3F42C5E2"
gosub "migrationstepname_FWM_FTA Generic Label_23"

setmigrationguid actualGUID

!! SET THE LEGACY PARAMETERS FOR FAVOURITES TO BE OFF
if GLOB_INTGUID = "" then
	parameters cut_fill_legacy = 0
endif


end !!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!


!!! migrationstepname
"migrationstepname_FWM_FTA Generic Label_23":
    if actualGuid = _startID then

        parameters cut_fill_legacy = 1  ! maintain reading of the cut fill on objects for older jobs  

        actualGuid = _endID
    endif
return
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2023 01:36:12 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Forward-Migration-Script-amp-Favourites/m-p/579681#M6037</guid>
      <dc:creator>scottjm</dc:creator>
      <dc:date>2023-12-11T01:36:12Z</dc:date>
    </item>
  </channel>
</rss>

