Create graphical Hotspots from a marco called Object

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

Tagged: ,

This topic contains 3 replies, has 2 voices, and was last updated by  Péter Baksa 4 months, 1 week ago.

  • 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
    Participant

    Hi Samantha,

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

    Péter Baksa
    Software Engineer, Library Team
    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
    Participant

    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
    Software Engineer, Library Team
    GRAPHISOFT SE

You must be logged in to reply to this topic.