Macro Not working on Grouped Shapes

Started by DM2, January 05, 2012, 12:30:01 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DM2

I want to create a P&ID symbol of a valve.  Symbol consists of two triangle shapes.  The idea is that if you double click on one of the triangle shapes, the fill color will change.  If it's white, it would change to black, and if it's black, change to white.

As long as the two shapes aren't grouped, the macro works fine.  when I group them it no longer works...what am i missing here?
Regards,
Dan
-------
"Real world Knowledge isn't dropped from a parachute in the sky but rather acquired in tiny increments from a variety of sources including panic and curiosity."


vojo

1.   You dont need a macro to do that
          - Open up shape sheet
          - Create a user.cell called   user.switch
          - in eventdblclk cell, set it to     setf(getref(user.switch), if (user.switch =1, 0, 1))
          - in fillforegnd cell, set it to    guard(if (user.switch, RGB(0,0,0), RGB(255,255,255)))
      What this does is that when you double click the shape, the user.switch cell flips.    The fillforegnd cell watches the user.switch and decides on color to use
      (if you dont want to use double click....can also do actions to do this)

2.   when you select, you are select the group first...to do what you want you need to do the following
          - At group level, right click group....format ==> behavior....  lower right set to either members first
          - For each shape in the group, if you really want to do this via some macro, then format ==> behavior....action set to the macro you want

Good luck

DM2

This took me a little bit but I think I understand.

Now, If I want to build some shapes and then make them a stencil, do I need to worry about them still functioning after i've created the stencil?
Regards,
Dan
-------
"Real world Knowledge isn't dropped from a parachute in the sky but rather acquired in tiny increments from a variety of sources including panic and curiosity."

Yacine

with vojo's shapesheet solution, the behaviour will be kept we the shape. So it will work also when droped out of a stencil.
If you make a macro driven solution, you need to make sure that the macro is loaded when using the shape, so store the macro in the stencil itself.
Yacine

Browser ID: smf (is_webkit)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 206 (show)
Files included: 34 - 1317KB. (show)
Memory used: 1098KB.
Tokens: post-login.
Cache hits: 12: 0.00182s for 26,582 bytes (show)
Cache misses: 1: (show)
Queries used: 15.

[Show Queries]