creating a ladder that extends when dragged

Started by royj123, January 30, 2013, 08:09:13 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

royj123

Hi All

i am using Visio 2007 and can someone please assist me on how to create a shape e.g. a ladder that can add rungs (steps) automatically as you extend it.
i have created a ladder by drawing two parallel lines and drew the little bars between them to represent the steps, this i have grouped. now i need to know how do i change its properties so as when i stretch the ends it will insert more steps automatically as i stretch it.

there is a shape under pipes and valves - pipes 1  called Signal Line that does the same effect i'm trying to do.

Any help will be greatly appreciated

Many thanks

Roy

JohnGoldsmith

Have a look at the attached.  It's just a quick draft, but basically it has a shape data row where you set the step height and then each step is represented by a separate geometry section which becomes visible as determined by User.VisibleSteps (see image).

If you want to add more steps just add more geometry sections on the end and copy the formulae across incrementing the appropriate index values and also note the maximum steps value (10) in User.VisibleSteps.

Note that, although I've added the steps as geometry sections, there's no particular reason why they couldn't be sub-shapes within a group instead (although I think the geometries are simpler).

Hope that helps

Best regards

John
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/

Jumpy

Another way (maybe not so flexible as the above one) could be a custom line- or fill-pattern.

vojo

and yet another way to do this (without VBA or manually adding geometries....if either of those is not desired) would be

This is pretty accurate...but probably not 100.000000000% accurate...but you get the idea
(I use similar approach to indicate whether a given RAID controller has Z number of drives present or not....sets colors based on there or not)

1. create a user cell that takes height / ladder gap and rounds down to integer...lets call it user.rungs
2. create a user cell that has the distance between rungs...aka a single gap between any 2 rungs....lets call it user.rungslice
3. In the geometry section....define say 30 rows
4. set move to to say the bottom ...something like width*0, Height*0
5. for each line row, something like this
       moveto x<n>     = guard(width*0)    y<n>     = guard(if(user.rung > <this rung index>, height*user.rungslice*<this rung index>, height*0)
       Line      x<n+1> = guard(width*1)    y<n+1> = guard(if(user.rung > <this rung index>, height*user.rungslice*<this rung index>, height*0)
       /// FYI...<this rung index> is an actual constant in each row...1,2,3,4,5,6,7,etc...aka its used to set this given rung to rung 12
       ///repeat for all 30 rows...this would give you 15 rungs
       /// the verticals could be rows 31/32....and....33/34   
       left vertical   x = width*0    y=height*0
                          x = width*0    y = height*1
       right vertical  x = width*1    y=height*0
                          x = width*1    y = height*1

Then beyond these 15 rungs....just copy/paste the shape and have them sit next to each
(could add a connection point so the shapes lock...would need to always move the new shape to lock into the old shape train for say 60 rungs)
(if you want to stay in since shape....could have multiple geometries then use a index/offset/trigger where that geometry starts or even )
(whether its actuall shown.....lastly, unless you really want to have lots of fun - sarcasm - I would suggest using line weight to make the )
(ladder "thicker" or "thiner")

Personally, I found that more control is better for this....so may want use props to define the values for the user cells and allow the
geoemtry to grow well beyond width and height.  Copy / paste as needed....but cant really do connections per se since last rung is first rung
if rung count is smaller than the max number of rows in geometry....previously, you set the connection points solely based on width and height
so always at the end regardless of number of rungs.

This general approach is tedious to set up...but real simple for end user
       

royj123

Hi all again,

Many thanks for all your support, i like johns way as it seems the easiest, but how do i go about changing the steps to say 20?.  how would i go about it if i wanted to have as many steps as possible e.g i can stretch it as far as i need.

i am actually using this to represent a palaside fence around a drawing of an estate, as i dont have any fence stencils in visio, and couldn't find any on the net.

Thanks

Roy

wapperdude

To extend John's method, as he indicated, you must add additional geometry sections.  Right click in the shapesheet, insert section, geometry.  Make each new section look the same as those that already exist, including adding the formulas to show/hide geometry.  You must also modify the formulas to allow for the added sections.  This approach will only "extend" as far as you have sections.

For a fence of unspecified length, then, Jumpy's solution might be best, using a custom fill pattern.  There are numerous articles on this on this blog site, one Visio Guy's main website, and he points to some very solid foundational work done by John Goldsmith (I believe ).  You would have to make a pattern that represents one piece of the the fence.  (Guess you could do a custom line too.)  But for a fill, you'd then draw an enclosed shape that represents the desired outline, shape of the fence and apply the custom fill.  The line pattern has the advantage that you could draw a single line, tracing your terrain.  The custom pattern would create your fence.  Either of these would be best for arbitrary lengths and for following changing terrain.  But, if you're making a fence out of pre-defined sections, then, John's method might be more appropriate as multiple "ladders" could be stacked end to end as you would do in the real world with fence sections.

HTH
Wapperdude
Visio 2019 Pro

royj123

Hi All Again,

Thanks for all your support, but i am really confused as i Right click on the shape but nothing comes up that says Geometry. I'm using Visio 2007.

what i have managed to now do is draw a rectangle and use a custom fill pattern as suggested by Wapperdude and Jumpy.

Its not my ideal solution but does work.

If anybody does have a picket fence or Palisade fence that is extendable id greatly appreciate it if they could please send me one, im not trying to be lazy here but am still trying to learn visio, i can do all the basic things but when it comes to something like this its out of my league. (at the moment)  ;)

Many Thanks

Roy

Jumpy

Quote from: royj123 on February 15, 2013, 10:36:12 AM
Thanks for all your support, but i am really confused as i Right click on the shape but nothing comes up that says Geometry. I'm using Visio 2007.

Sounds as if you should first learn sth. about the ShapeSheet.

JohnGoldsmith

Hello Roy,

Sorry, I'd made an assumption that you were familiar with the ShapeSheet.  Have a look at this post to get going:

http://visualsignals.typepad.co.uk/vislog/2007/10/just-for-starte.html

Best regards

John
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/

wapperdude

#9
...so, a reference to get acquainted with the shapesheet is:  http://msdn.microsoft.com/en-us/library/office/ms409187(v=office.12).aspx

One way to get to the shapesheet of an object (shape), well, at least for V2007 and lower...
  > place the shape on the drawing
  > select shape
  > goto menu bar > window > show shapesheet.

In the shapesheet window, right click with the mouse shows a popup window.  Use that to insert more sections, e.g., geometry sections.  These get sequencially labelled.

One of the best techniques for learning the shapesheet is to open one of an existing shape and study the entries.

HTH
Wapperdude

PS:  John posted his reply while I was working on mine.  You should have two good links regarding shapesheets.
Visio 2019 Pro