<?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: Scope of HOTSPOT2 identifiers in a macro object? in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/Scope-of-HOTSPOT2-identifiers-in-a-macro-object/m-p/165652#M22072</link>
    <description>I am tackling a similar problem at the moment.&lt;BR /&gt;
&lt;BR /&gt;
When you call your macro you need to pass on a parameter like &lt;FONT color="#ff0009"&gt;HSID_add = 1000&lt;/FONT&gt;.&lt;BR /&gt;
&lt;BR /&gt;
Then in your macro you obviously need a parameter for &lt;FONT color="#ff0009"&gt;HSID_add&lt;/FONT&gt;.&lt;BR /&gt;
All of the hotspots in the macro need to have this value added to the unique ID.&lt;BR /&gt;
HOTSPOT2, 0, 0, UNID + HSID_add&lt;BR /&gt;
UNID = UNID + 1&lt;BR /&gt;
&lt;BR /&gt;
The next time you call the macro (from the same object) you must increase the HSID_add value.&lt;BR /&gt;
&lt;FONT color="#ff0009"&gt;CALL "macro" PARAMETERS HSID_add = 2000&lt;/FONT&gt;.&lt;BR /&gt;
&lt;FONT color="#ff0009"&gt;CALL "macro" PARAMETERS HSID_add = 3000&lt;/FONT&gt;.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
You can still use UNID and increase it by 1 after every hotspot but this can cause problems if you want to attach dimension to your objects.&lt;BR /&gt;
Especially when they have IF &amp;gt; THEN statements with hotspots in them.&lt;BR /&gt;
Then the ID numbers change and the dimension jump to the different points in plan.&lt;BR /&gt;
&lt;BR /&gt;
It is best to use fixed ID's instead of UNID = UNID + 1.&lt;BR /&gt;
HOTSPOT2, 0, 0, 1+ HSID_add&lt;BR /&gt;
HOTSPOT2, 0, 0, 2+ HSID_add&lt;BR /&gt;
&lt;BR /&gt;
You just have to be careful and keep track of what UNID numbers have been used.&lt;BR /&gt;
&lt;BR /&gt;
This all seems to work fine where you only have one level of macro calls.&lt;BR /&gt;
i.e. object_1 calls macro_1&lt;BR /&gt;
&lt;BR /&gt;
But starts getting messy when your macros start calling other macros.&lt;BR /&gt;
object_1 calls macro_1 and macro_1 calls macro_2&lt;BR /&gt;
Then later object_1 calls macro_1 again.&lt;BR /&gt;
You need to know exactly what is calling what so you can set the HSID_add value appropriately or as I am trying at the moment parsing a parameter macro_level = macro_level + 1 and multiplying the HSID_add variable by (10^macro_level).&lt;BR /&gt;
&lt;BR /&gt;
This will create unique ID numbers completely clear of any others as they will be increased by a factor of 10 at each macro level.&lt;BR /&gt;
So long as it ID's are unique it doesn't seem to matter what the size of the number is.&lt;BR /&gt;
&lt;BR /&gt;
The trick is getting them to be unique for all instances.&lt;BR /&gt;
&lt;BR /&gt;
Sorry if I complicated the issue at all but the first part of my post will solve your problem.&lt;BR /&gt;
&lt;BR /&gt;
As far as I know duplicate or changing ID's are only a problem when you want to dimension the object.&lt;BR /&gt;
I noticed this with the new automatic annotation for doors and windows in the interactive schedules in version 13.&lt;BR /&gt;
Graphisoft recommend unique and fixed ID's.&lt;BR /&gt;
&lt;BR /&gt;
Barry.</description>
    <pubDate>Thu, 07 Jan 2010 02:41:57 GMT</pubDate>
    <dc:creator>Barry Kelly</dc:creator>
    <dc:date>2010-01-07T02:41:57Z</dc:date>
    <item>
      <title>Scope of HOTSPOT2 identifiers in a macro object?</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Scope-of-HOTSPOT2-identifiers-in-a-macro-object/m-p/165650#M22070</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;I was tinkering with hotspot-based editing commands and I ran into an annoying problem. I have a 2D script and I want to be able to call the same macro several times based on parameters of the object calling the macro. The macro defines and places the hotspots since the geometry to manipulated is created in the macro.&lt;BR /&gt;
&lt;BR /&gt;
The problem is that if I call the macro more than once I get an error when trying to place the object saying that the hotspot identifies are no longer unique? I assumed the scope of the identifier would be localized to the macro object, not the calling object but this seems to be false?&lt;BR /&gt;
&lt;BR /&gt;
If for whatever reason this is actually functioning as intended is their any way I can get around this limitation without creating a parameter and passing it when I call the macro? Ideally the macro would keep track of the identification assignments internally rather than having the calling object track the identifiers - can this be done?&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance.&lt;/T&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 06 Jan 2010 23:11:52 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Scope-of-HOTSPOT2-identifiers-in-a-macro-object/m-p/165650#M22070</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-01-06T23:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: Scope of HOTSPOT2 identifiers in a macro object?</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Scope-of-HOTSPOT2-identifiers-in-a-macro-object/m-p/165651#M22071</link>
      <description>I had that problem with some of my Macro Objects that were upgraded to utilize the graphical editing Hotspots when the option was introduced. You need to hard-code a start uiID# in the receiving Object (that is calling the Macro) to reset the ID count for each instance the Macro is called. Then create a parameter in the Macro Object to receive the assigned uiID#. This way the Macro just loops the ID #s within itself without errors while being called multiple times in the receiving Object.</description>
      <pubDate>Thu, 07 Jan 2010 02:11:31 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Scope-of-HOTSPOT2-identifiers-in-a-macro-object/m-p/165651#M22071</guid>
      <dc:creator>David Larrew</dc:creator>
      <dc:date>2010-01-07T02:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: Scope of HOTSPOT2 identifiers in a macro object?</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Scope-of-HOTSPOT2-identifiers-in-a-macro-object/m-p/165652#M22072</link>
      <description>I am tackling a similar problem at the moment.&lt;BR /&gt;
&lt;BR /&gt;
When you call your macro you need to pass on a parameter like &lt;FONT color="#ff0009"&gt;HSID_add = 1000&lt;/FONT&gt;.&lt;BR /&gt;
&lt;BR /&gt;
Then in your macro you obviously need a parameter for &lt;FONT color="#ff0009"&gt;HSID_add&lt;/FONT&gt;.&lt;BR /&gt;
All of the hotspots in the macro need to have this value added to the unique ID.&lt;BR /&gt;
HOTSPOT2, 0, 0, UNID + HSID_add&lt;BR /&gt;
UNID = UNID + 1&lt;BR /&gt;
&lt;BR /&gt;
The next time you call the macro (from the same object) you must increase the HSID_add value.&lt;BR /&gt;
&lt;FONT color="#ff0009"&gt;CALL "macro" PARAMETERS HSID_add = 2000&lt;/FONT&gt;.&lt;BR /&gt;
&lt;FONT color="#ff0009"&gt;CALL "macro" PARAMETERS HSID_add = 3000&lt;/FONT&gt;.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
You can still use UNID and increase it by 1 after every hotspot but this can cause problems if you want to attach dimension to your objects.&lt;BR /&gt;
Especially when they have IF &amp;gt; THEN statements with hotspots in them.&lt;BR /&gt;
Then the ID numbers change and the dimension jump to the different points in plan.&lt;BR /&gt;
&lt;BR /&gt;
It is best to use fixed ID's instead of UNID = UNID + 1.&lt;BR /&gt;
HOTSPOT2, 0, 0, 1+ HSID_add&lt;BR /&gt;
HOTSPOT2, 0, 0, 2+ HSID_add&lt;BR /&gt;
&lt;BR /&gt;
You just have to be careful and keep track of what UNID numbers have been used.&lt;BR /&gt;
&lt;BR /&gt;
This all seems to work fine where you only have one level of macro calls.&lt;BR /&gt;
i.e. object_1 calls macro_1&lt;BR /&gt;
&lt;BR /&gt;
But starts getting messy when your macros start calling other macros.&lt;BR /&gt;
object_1 calls macro_1 and macro_1 calls macro_2&lt;BR /&gt;
Then later object_1 calls macro_1 again.&lt;BR /&gt;
You need to know exactly what is calling what so you can set the HSID_add value appropriately or as I am trying at the moment parsing a parameter macro_level = macro_level + 1 and multiplying the HSID_add variable by (10^macro_level).&lt;BR /&gt;
&lt;BR /&gt;
This will create unique ID numbers completely clear of any others as they will be increased by a factor of 10 at each macro level.&lt;BR /&gt;
So long as it ID's are unique it doesn't seem to matter what the size of the number is.&lt;BR /&gt;
&lt;BR /&gt;
The trick is getting them to be unique for all instances.&lt;BR /&gt;
&lt;BR /&gt;
Sorry if I complicated the issue at all but the first part of my post will solve your problem.&lt;BR /&gt;
&lt;BR /&gt;
As far as I know duplicate or changing ID's are only a problem when you want to dimension the object.&lt;BR /&gt;
I noticed this with the new automatic annotation for doors and windows in the interactive schedules in version 13.&lt;BR /&gt;
Graphisoft recommend unique and fixed ID's.&lt;BR /&gt;
&lt;BR /&gt;
Barry.</description>
      <pubDate>Thu, 07 Jan 2010 02:41:57 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Scope-of-HOTSPOT2-identifiers-in-a-macro-object/m-p/165652#M22072</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2010-01-07T02:41:57Z</dc:date>
    </item>
  </channel>
</rss>

