a bunch of questions

I

ichanops

Hello Group!

I need help.

Want to select a box 'n paint it red. The box is grouped with several other
shapes. Everytime I click, I get the group shape not the box. How to get
the box??

Second question: Is it possible to resize a textbox or a box depending on
the text inside? So it will resize according to the text's length; the font
is not monospace btw.


Another question: Can I put the text of a Connector at the start or end
point instead of the default which is at the center?


Another one: How to turn on Glue to Shape Geometry in coding (C#)?

Last one: Is there an auto-arrange method that can be called, so that
shapes arrange themselves nicely?



Lotsa thanks!

- ichanop
 
I

ichanops

Can you help me with the first question? I really stuck on that one.
I did what the sample in SDK tell me to do; using
clickedWindow.PageAsObj.get_SpatialSearch() method I got the Selection
consisting of shape(s). Within this Selection I do iteration and each
Selection I do iteration of Shapes, there then I found my shape. So
basically the shape I want (a box) is within a grouped shape. But is
that box is currently selected or not I dunno cause there's no property
telling that it is currently selected. What if I select a circle within
the same grouped shape? the get_SpatialSearch() only returns the grouped
shape, not the shape within even if the shape within is actually
selected. Please help me get the box, please. Thank you for your help.

- ichanop
 
A

Al Edlund

I'd probably approach it a little differently. When you select the object on
the page Visio will fire off a 'Window Selection Changed' event which can be
captured. I would then check to see what object(s) were selected (i.e.
iterate through the list). Each object will have to be checked to see if it
is a simple or group, something like this

If visShape.Type = visTypeGroup Then
'Debug.Print "it is a group
Set visEmbShape = visShape.Shapes(X) ' where x is the sub
shape in the group
'Debug.Print "instantiate an embedded shape"
' do something with the shape (examine, alter, etc.)
End If

al

ichanops said:
Can you help me with the first question? I really stuck on that one.
I did what the sample in SDK tell me to do; using
clickedWindow.PageAsObj.get_SpatialSearch() method I got the Selection
consisting of shape(s). Within this Selection I do iteration and each
Selection I do iteration of Shapes, there then I found my shape. So
basically the shape I want (a box) is within a grouped shape. But is
that box is currently selected or not I dunno cause there's no property
telling that it is currently selected. What if I select a circle within
the same grouped shape? the get_SpatialSearch() only returns the grouped
shape, not the shape within even if the shape within is actually
selected. Please help me get the box, please. Thank you for your help.

- ichanop



most of what you have asked is in this document
http://msdn.microsoft.com/library/en-us/devref/HTML/DVS_01 _Introduction
__544.asp?frame=true

after that can check into David Edson's book, followed by an even more
detaile review from Graham Widemans book (visio developers survival
...) al
 
I

ichanops

but the problem is the X; how to get which visShape.Shapes(X) that is
selected (have that green dotted line).

among all shapes within visShape, let's say there are two: rect and
circle; how do I know that currently the rect is selected?


ichanop


I'd probably approach it a little differently. When you select the
object on the page Visio will fire off a 'Window Selection Changed'
event which can be captured. I would then check to see what object(s)
were selected (i.e. iterate through the list). Each object will have
to be checked to see if it is a simple or group, something like this

If visShape.Type = visTypeGroup Then
'Debug.Print "it is a group
Set visEmbShape = visShape.Shapes(X) ' where x is the
sub
shape in the group
'Debug.Print "instantiate an embedded shape"
' do something with the shape (examine, alter, etc.)
End If

al

ichanops said:
Can you help me with the first question? I really stuck on that one.
I did what the sample in SDK tell me to do; using
clickedWindow.PageAsObj.get_SpatialSearch() method I got the
Selection consisting of shape(s). Within this Selection I do
iteration and each Selection I do iteration of Shapes, there then
I found my shape. So basically the shape I want (a box) is within a
grouped shape. But is that box is currently selected or not I dunno
cause there's no property telling that it is currently selected. What
if I select a circle within the same grouped shape? the
get_SpatialSearch() only returns the grouped shape, not the shape
within even if the shape within is actually selected. Please help me
get the box, please. Thank you for your help.

- ichanop



most of what you have asked is in this document
http://msdn.microsoft.com/library/en-us/devref/HTML/DVS_01 _Introduction
__544.asp?frame=true

after that can check into David Edson's book, followed by an even
more detaile review from Graham Widemans book (visio developers
survival ...) al

Hello Group!

I need help.

Want to select a box 'n paint it red. The box is grouped with
several other
shapes. Everytime I click, I get the group shape not the box. How
to get the box??

Second question: Is it possible to resize a textbox or a box
depending on the text inside? So it will resize according to the
text's length; the font
is not monospace btw.


Another question: Can I put the text of a Connector at the start or
end point instead of the default which is at the center?


Another one: How to turn on Glue to Shape Geometry in coding (C#)?

Last one: Is there an auto-arrange method that can be called, so
that shapes arrange themselves nicely?



Lotsa thanks!

- ichanop

 
M

Mark Nelson [MS]

ActiveWindow.Selection returns a Selection object that contains the
currently selected shapes. When working with groups, you need to set the
IterationMode property on the Selection object so that Visio reports on the
sub-shapes in the selection.

--
Mark Nelson
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.

ichanops said:
but the problem is the X; how to get which visShape.Shapes(X) that is
selected (have that green dotted line).

among all shapes within visShape, let's say there are two: rect and
circle; how do I know that currently the rect is selected?


ichanop


I'd probably approach it a little differently. When you select the
object on the page Visio will fire off a 'Window Selection Changed'
event which can be captured. I would then check to see what object(s)
were selected (i.e. iterate through the list). Each object will have
to be checked to see if it is a simple or group, something like this

If visShape.Type = visTypeGroup Then
'Debug.Print "it is a group
Set visEmbShape = visShape.Shapes(X) ' where x is the
sub
shape in the group
'Debug.Print "instantiate an embedded shape"
' do something with the shape (examine, alter, etc.)
End If

al

ichanops said:
Can you help me with the first question? I really stuck on that one.
I did what the sample in SDK tell me to do; using
clickedWindow.PageAsObj.get_SpatialSearch() method I got the
Selection consisting of shape(s). Within this Selection I do
iteration and each Selection I do iteration of Shapes, there then
I found my shape. So basically the shape I want (a box) is within a
grouped shape. But is that box is currently selected or not I dunno
cause there's no property telling that it is currently selected. What
if I select a circle within the same grouped shape? the
get_SpatialSearch() only returns the grouped shape, not the shape
within even if the shape within is actually selected. Please help me
get the box, please. Thank you for your help.

- ichanop




most of what you have asked is in this document
http://msdn.microsoft.com/library/en-us/devref/HTML/DVS_01
_Introduction
__544.asp?frame=true

after that can check into David Edson's book, followed by an even
more detaile review from Graham Widemans book (visio developers
survival ...) al

Hello Group!

I need help.

Want to select a box 'n paint it red. The box is grouped with
several other
shapes. Everytime I click, I get the group shape not the box. How
to get the box??

Second question: Is it possible to resize a textbox or a box
depending on the text inside? So it will resize according to the
text's length; the font
is not monospace btw.


Another question: Can I put the text of a Connector at the start or
end point instead of the default which is at the center?


Another one: How to turn on Glue to Shape Geometry in coding (C#)?

Last one: Is there an auto-arrange method that can be called, so
that shapes arrange themselves nicely?



Lotsa thanks!

- ichanop


 

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