Double-click Shape and Get Drop-down List...?

Started by RaWaS, November 07, 2009, 04:44:55 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Simple question

Not really a poll
0 (0%)
Not really a poll
0 (0%)

Total Members Voted: 0

RaWaS

I have a shape which have shape data like:

OutSlope
TapSlope
InLevel
OutLevel
TapLevel

How to do  what on double click on this shape appear drop down list where I can select numbers from 1 to 10 and according on that number fill OutSlope and TapSlope Value field.
for example
if select 1 then OutSlope = 2 and TapSlope = 10
if select 5 then OutSlope = 3 and TapSlope = 50
if select 7 then OutSlope = 6 and TapSlope = 25
I need get data from text or excel file better, but also be great other things.

Also I need to work code like that:

InLevel value must take from connected shape I think must be somthing like = ConnectFrom and take value from this shape cell named Level
OutLevel = InLevel - OutSlope
TapLevel = Inlevel - TapSlope

Any ideas?

vojo

#1
custom properties and user cells can do all this for you.

Custom properties is in the shapes menu.  If you create an action....docmd(1312) will call up the custom properties.
You defined the type/format of the information and have help tips for each.

The user cells can be used to do all the calculations you want.    right click shape...open shapesheet...insert section....user

Custom properties show up as prop cells.

Start with a simple square....add some custom props...work some action buttons...add some user cells... generally play around for an hour or so...you will get the gist....then go after what you want.


RaWaS

#2
Thanks for reply. But I need know that exactly to do, maybe example of how to :) in vba i can do this but i never worked in Visio, so please write me directly what i must do.

vojo

#3
real simple

See shape attached

RaWaS

#4
Thanks vojo, It's good idea, but I have 100 of different shapes where I need to set values only by selected number, so values for each number must be somewhere in external file or in shape data array ? And what about InLevel value must be taked from connected shape data I think must be somthing like = ConnectFrom and take value from this shape cell named Level

vojo

Well that is a whole different problem.   Can be done and numerous examples in this forum...but it does take some heavy lifting to make useful.   Good luck

wapperdude

#6
Here are a couple of links that might give you ideas on how to attack this:  
- Automatically Number & Connect Shapes – With Code
- Path Analysis in Visio
- Analyze Connectivity Between Process Flows

HTH
Wapperdude
Visio 2019 Pro

RaWaS

Thats links is not helpful, because I need get values not from VBA but in shape data cell whith formula.
I need exactly formula code which I can insert in masters shape and when droped 100 of this shapes each shape automaticly get values in specified cell of shape data.
For example I create master shape, I create Prop.GetFrom  cell, in value field I need to insert code which get data from shape cell named Prop.OutLevel to which this shape connected to. Not VBA!!!

Visio Guy

Hi RaWaS,

Some more tips. Read and write from cells:

string f = shp.get_Cells("Prop.GetFrom").Formula;
string f = shp.get_Cells("Prop.GetFrom").ResultStr( Visio.VisUnitCodes.VisNoCast );

shp.get_Cells("Prop.GetFrom").Formula = "\"Some Value\"";
shp.get_Cells("Prop.GetFrom").ResultIU =  3.14

And:

Edit Visio Masters Programmatically...the Right Way!
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

RaWaS

How I can understand shp is a variable, and must be set somewhere, how I can set it i shape data and where? Maybe anyone write me example in vsd ? And how to define to which shape connection point, this shape is connected? The code only must be in shape data not in VBA!!!!!!!!!!!!!! And refresh on connection point change.

Visio Guy

There is no code in the ShapeSheet. Just formulas. Sometimes you need code to do advanced operations, and this needs to be run from VBA, or C#/VB.Net add-ons or executables.
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

aledlund

Which appears to be one of the incorrect preassumptions of the request for excel data into a drawing that 'RaWaS' is also making.
al

RaWaS

So where are no ways to know from wich shape coming connector to this shape using only shape sheet?

vojo


RaWaS

But in VBA it's must be very slow. And that to do if I have 1000-nd of shapes? I have to every time to update each shape and refresh all of them :)))