Creating a shape that asks for colorfill on drop?

Started by Mahisse, October 22, 2013, 02:19:11 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mahisse

Hi there. I'm new to the forum but have been lurking from time to time.

I'm currently creating a Visio template for work for others to use and I want to create a reference shape that should be the same color as the shaped that is referred to. I have searched and searched for this topic on google but there's not alot of topics on creating a shape with certain functions. All shape related material that I could find is very basic even though I know it can be very complex.

Would it be fairly simple to make a shape (maybe just use the off-page reference shape) that will ask for a color format when you drop the shape into the document? I have Visio 2010 but do not have Prof. og Premium but I'm hoping that I won't need the data tab for, what seems like a simple shape function.

Can anyone explain how to overcome this problem?

Any link to relevant toturials are also more than welcome.

Best regards

wapperdude

I don't have V2010, but I think the method is unchanged from previous versions...

Select the shape and open the shapesheet (this is slightly different for V2010...don't recall how to access it exactly, but I think it's under the developer tab on the ribbon).

Once shapesheet is open scroll down to the Events section.  In the cell labeled EventDrop, enter the command "docmd(1066)" without the quotes.  That's it.

Wapperdude
Visio 2019 Pro

Nikolay

>  I want to create a reference shape that should be the same color as the shaped that is referred to

Hmmm.. could you please clarify, what do you mean by this..
What do you mean by "shape refers to another shape"?

> Would it be fairly simple to make a shape (maybe just use the off-page reference shape) that will ask for a color format when you drop the shape into the document?

Do you need your user to select arbitrary color (in this case please refer to the post by wapperdude) or a color from predefined fixed list?
In the second case, you could add a custom property, say "Color" - a fixed list, and then use it's value in shape sheet's in "FillColor" cell.

Mahisse

Quote from: wapperdude on October 22, 2013, 02:54:08 PM
I don't have V2010, but I think the method is unchanged from previous versions...

Select the shape and open the shapesheet (this is slightly different for V2010...don't recall how to access it exactly, but I think it's under the developer tab on the ribbon).

Once shapesheet is open scroll down to the Events section.  In the cell labeled EventDrop, enter the command "docmd(1066)" without the quotes.  That's it.

Wapperdude

Well that's some of it I guess. What I really wanted was a dialog box coming up where you could choose a color but I understand that probably would be far more complicated since I would need to also make the dialog box... I guess.

Mahisse

Quote from: Nikolay on October 22, 2013, 04:41:28 PM
>  I want to create a reference shape that should be the same color as the shaped that is referred to

Hmmm.. could you please clarify, what do you mean by this..
What do you mean by "shape refers to another shape"?

A bit of a typo there.. When a user is dropping an "on-page reference" shape I want a box/list asking for a color fill.

> Would it be fairly simple to make a shape (maybe just use the off-page reference shape) that will ask for a color format when you drop the shape into the document?

Quote from: Nikolay on October 22, 2013, 04:41:28 PM
In the second case, you could add a custom property, say "Color" - a fixed list, and then use it's value in shape sheet's in "FillColor" cell.

Yes this is what I would like to do, thanks I'll try it out.

Mahisse

Solved it with this guide:
http://www.visguy.com/2009/10/21/choose-colors-with-shape-data-fields/
Thanks for leading me in the right direction. Annoying issue with the European version vs the US regarding the seperators though. But luckily with an easy work around.

New problem though. I can't decide if I should make a new thread for it. If I don't receive any answers I'll probably make a new thread.

I have a costumized theme color in my template and all is good except for that #%£$€ annoing swimlane (I'm making a cross functional map). When I'm trying to change the themecolor of the swimlane there are some issues:
I can change the themecolor but if I do I lose the "dynamic function" in swamlanes. Meaning it will alway read the formated swimlane as the "first", creating a title and a phase "box" each time I drop a new swimlane and it won't snap to the original swimlane. How do I change the format of the Title and Phase box without this happening?

Thank you for your help

Paul Herber

Or you can fill the shape's EventDrop cell with the formula
=DOCMD(1066)

Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

Mahisse

Doesn't bring up a dialog box "forcing" the user to choose a color. Thank for the answer though.

Do you have any inputs about my swimlane problem? :D

Paul Herber

You wanted "ask", not "force". Force will never be an option, there will always be a cancel button.
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

Mahisse

Hence the quotes around "force" :). All the other command does is bringing up the format view.
This is more to make the users aware of a guideline I would like them use, thus an dialog box explaining this with some choices of standardized colors was the best solution in my opinion.

Paul Herber

If you just want to display some text then you could use my:
http://www.sandrila.co.uk/articles/visio-articles/output-dialog/
and put the cell formula in the EventDrop cell instead.
I must add that to the article!
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

Paul Herber

or you can do both by having both events in the cell:
=RUNADDONWARGS("outputdialog2","Please select a colour")+DOCMD(1066)
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

Paul Herber

D'oh, I didn;t read the whole thread, sorry Wapperdude!
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

Mahisse

Thank you for the replies.. I will create a new thread about my swimlane problem :)

wapperdude

Visio 2019 Pro

Browser ID: smf (possibly_robot)
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: 419 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1263KB.
Tokens: post-login.
Cache hits: 13: 0.00169s for 26,544 bytes (show)
Cache misses: 3: (show)
Queries used: 16.

[Show Queries]