Create graphical Hotspots from a marco called Object

Home Forums General discussions Create graphical Hotspots from a marco called Object

Tagged: ,

Viewing 3 reply threads
  • Author
    Posts
    • #4584
      Samantha Mar Braga
      Participant

      Which is the best way to get the graphical hotspots from a macro called object with several instance in a parent one?
      I tried that hotspotID and the angle rotation takes the value from a parameter an change in to a single “call” command, but it doesn’t work

    • #4585
      Péter Baksa
      Keymaster

      Hi Samantha,

      are you trying to make editable hotspots, or fixed ones?

      Péter Baksa
      Library Platform, Software Engineer
      GRAPHISOFT SE

    • #4589
      Samantha Mar Braga
      Participant

      Hi Péter! Thanks for the quick answer!
      I’m trying to make the editable hotspots the magenta ones.

    • #4590
      Péter Baksa
      Keymaster

      If you need different rotations in each instance, you have to use a different parameter in each. The hotspot uses the parameter belonging to the parent object, not the macro.
      A solution for this could be that you pass an array of rotations, and an index telling which one to use from the array for the hotspot.

      An example with simpler length editing:
      parent:

      for i = 1 to 2
      	call "testmacro" parameters x = x, i = i
      	line2 0, 0, x[i], 0
      	add2 0, 0.1
      next i
      del 2

      macro:

      unID = (i - 1) * 3 + 1
      
      hotspot2 0,	0,	unID, x[i], 1 + 128	: unID = unID + 1
      hotspot2 x[i],	0,	unID, x[i], 2		: unID = unID + 1
      hotspot2 -1,	0,	unID, x[i], 3 		: unID = unID + 1

      parameters in both:
      x as length array
      i as integer

      Péter Baksa
      Library Platform, Software Engineer
      GRAPHISOFT SE

Viewing 3 reply threads
  • The forum ‘General discussions’ is closed to new topics and replies.