Shapes with Alternate Views

W

WapperDude

I would like to modify some shapes that I've created to have selectable
views. Is there a good reference that indicates how to do this? I am making
a set of shapes to create audio components for rack mounting. For each
component, I would like to switch between front and rear views. This would
be similar to the electrical symbols, e.g., a resistor, that allows you to
select different views for fixed or variable resistance.
 
P

Paul Herber

I would like to modify some shapes that I've created to have selectable
views. Is there a good reference that indicates how to do this? I am making
a set of shapes to create audio components for rack mounting. For each
component, I would like to switch between front and rear views. This would
be similar to the electrical symbols, e.g., a resistor, that allows you to
select different views for fixed or variable resistance.

The way to do this is to create separate geometry sections (see the
shape's shapesheet) for each part that needs to be made
visible/invisible.
Each geometry section has a Visible attribute, you need to add an
Actions section to the shape, the action will give you a right-click
menu to which you can add the controls to
a. toggle the visible attributes of the geometry sections
b. toggle the tick on your new menu.

Have a look in the Visio SDK and look in detail at the various shapes
that have one of these added menus. there are plenty within the
standard Visio shapes.
 
W

WapperDude

Hi Paul,
Not sure this totally applies. My shapes consist of a line converted to a
group with a picture added. See post titled Rack Mountede Equipment Shapes.
So, based upon that info, what I did was to create two layers, front and
back, assign one picture to the front layer and the 2nd picture to the back
layer. Then, I created a single group. I was hoping that a right click on
the shape would let me choose either front or back. In the shapes sheet,
only the line shows under geometry. Reasonable. There is a layer membership
section, but it is blank and I have no idea what to do with it. So, does the
SDK guide me thru all of this?
 
D

David Parker

Forget trying to use the layer to control visibility of your 2 images.
Simply :

Create a group level User-defined cell, named, say, ShowFront.
Create a group level Action with formula
SETF(GetRef(User.ShowFront),NOT(User.ShowFront))
Set the Checked cell to User.ShowFront

Then in the front image shapesheet:
Set ImgWidth = Width*(Sheet.5!User.ShowFront)
Set ImgHeight = Height*(Sheet.5!User.ShowFront)
Then in one the rear image shapesheet:
Set ImgWidth = Width*NOT(Sheet.5!User.ShowFront)
Set ImgHeight = Height*NOT(Sheet.5!User.ShowFront)

Where Sheet.5 is the group shape that contains the two image shapes
 
W

WapperDude

Thank you David, your suggestions got me to 90% of where I need to go, and
gave me enough info to finish the job! Missing was the right click on the
shape to toggle between "front" and "rear" views. So, what I have is as
follows:
In the User Defined Cell Section I have:
User.ShowFront; value=1
User.Form; value=Actions.Row_2.Action
User.visDescription; value="Front View" (Don't know if this is needed.)

In the Actions Section I have:
Actions.ShowFront;
action=SETF(GetRef(User.ShowFront),NOT(User.ShowFront));
Checked=User.ShowFront

Actions.Row_2; action=NOT(User.Form); Menu="Show &Alternate View"
Actions.Row_3; action=SETF(GetRef(User.ShowFront),1); Menu="_F&ront";
Checked=User.ShowFront=1

Actions.Row_4; action=SETF(GetRef(User.ShowFront),0); Menu="_R&ear";
Checked=User.ShowFront=0

This seems to complete the task. I don't know what most of these entries
do, I just followed other shapesheet examples. Is there some documentation
that describes what I just did? :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top