new shape in another shape 
Author Message
 new shape in another shape

Hi, guys,
In VBA, I need to create a shape dynamically in another shape and position
it properly.  The new shape will be deleted, and a another new shape must be
created and placed in the exact same place.

How can I do that?

Thanks.

Tony



Sun, 02 Oct 2005 07:25:47 GMT  
 new shape in another shape

Quote:
> Hi, guys,
> In VBA, I need to create a shape dynamically in another shape and position
> it properly.  The new shape will be deleted, and a another new shape must
be
> created and placed in the exact same place.

> How can I do that?

Tony:

You don't say if you want the new shape to simply appear on the page at the
same location of the old shape, or whether you want the new shape to be a
member-shape of the old shape.

If you just want it in the same location, then drop it by any of the usual
methods, for example MyMaster.Drop or Page.DrawRectangle, and set the PinX
and PinY cells to values copied from the old shape.

If you want the new shape to be a member of the old shape, then first make
sure that the old shape is also a group (Shape.ConvertToGroup) and then drop
the new shape into the group (Shape.Drop MyMaster...)

Hope that helps.

Graham

--
---------------------------------------------------
Graham Wideman
Microsoft Visio MVP
---------------------------------------------------
Book/Tools:
Visio 2002 Developer's Survival Pack
Resources for programmable diagramming at:
http://www.diagramantics.com

.



Sun, 02 Oct 2005 17:36:02 GMT  
 new shape in another shape
Thanks so much, Graham.  Do you have any quick sample code for this?

Tony


Quote:


> > Hi, guys,
> > In VBA, I need to create a shape dynamically in another shape and
position
> > it properly.  The new shape will be deleted, and a another new shape
must
> be
> > created and placed in the exact same place.

> > How can I do that?

> Tony:

> You don't say if you want the new shape to simply appear on the page at
the
> same location of the old shape, or whether you want the new shape to be a
> member-shape of the old shape.

> If you just want it in the same location, then drop it by any of the usual
> methods, for example MyMaster.Drop or Page.DrawRectangle, and set the PinX
> and PinY cells to values copied from the old shape.

> If you want the new shape to be a member of the old shape, then first make
> sure that the old shape is also a group (Shape.ConvertToGroup) and then
drop
> the new shape into the group (Shape.Drop MyMaster...)

> Hope that helps.

> Graham

> --
> ---------------------------------------------------
> Graham Wideman
> Microsoft Visio MVP
> ---------------------------------------------------
> Book/Tools:
> Visio 2002 Developer's Survival Pack
> Resources for programmable diagramming at:
> http://www.diagramantics.com

> .



Mon, 03 Oct 2005 23:02:15 GMT  
 new shape in another shape
Hi, Graham,
There is another question.  Since I need to redraw a shape every second in
my application, is there any performance penalty for doing this instead of
creating a set of shapes and showing/hiding them?  I am new to Visio and
need your professional advise.

Appreciate your help.

Xiaopeng


Quote:


> > Hi, guys,
> > In VBA, I need to create a shape dynamically in another shape and
position
> > it properly.  The new shape will be deleted, and a another new shape
must
> be
> > created and placed in the exact same place.

> > How can I do that?

> Tony:

> You don't say if you want the new shape to simply appear on the page at
the
> same location of the old shape, or whether you want the new shape to be a
> member-shape of the old shape.

> If you just want it in the same location, then drop it by any of the usual
> methods, for example MyMaster.Drop or Page.DrawRectangle, and set the PinX
> and PinY cells to values copied from the old shape.

> If you want the new shape to be a member of the old shape, then first make
> sure that the old shape is also a group (Shape.ConvertToGroup) and then
drop
> the new shape into the group (Shape.Drop MyMaster...)

> Hope that helps.

> Graham

> --
> ---------------------------------------------------
> Graham Wideman
> Microsoft Visio MVP
> ---------------------------------------------------
> Book/Tools:
> Visio 2002 Developer's Survival Pack
> Resources for programmable diagramming at:
> http://www.diagramantics.com

> .



Mon, 03 Oct 2005 23:07:56 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Shapes shapes shapes

2. Adding a shape from Forms Shapes Stencil

3. How to differentiate a shape created from Stencil drag/drop and shape Copy/Paste

4. How to update document master shapes from template master shapes

5. Dynamically convert shapes to Process Engineering shapes

6. Dropping shapes through VBA with shape Custom Properties setting ASK =True

7. Convert Inline to Shape and Anchor Shape

8. grouping shapes and convert to inline shape

9. VB6 Question re: Data Shaping relations and Shape query

10. Combining Shape Append & Shape Compute

11. VB6 Question re: Data Shaping relations and Shape query

12. VB6 Question re: Data Shaping relations and Shape query

 

 
Powered by phpBB® Forum Software