Visio Guy

Visio Discussions => Programming & Code => Topic started by: richardmaysundo on April 24, 2009, 08:41:52 PM

Title: C# Project: how to rotate shapes and get data from them
Post by: richardmaysundo on April 24, 2009, 08:41:52 PM
Hello everyone, my names is Richard and i thank god i found visioguys's web page  ;D

Currently i'm working on a project in which i need to integrate Visio with a winform application, written in C# with VS .NET 2003.

I somehow managed to do the basics (adding axdrawingcontrol, show stencil, identify clicked shapes and shapes drawn on the visio design page, etc), but i am having a REALLY hard time when trying to rotate the shapes, and also access some information from them (such angle, x, y, etc).

I would eternally appreciate all your suggestions/tips/help  :'(

Thanks in advance.

Richard.

Title: Re: C# Project: how to rotate shapes and get data from them
Post by: VisioBut on August 08, 2009, 05:45:04 PM
Hi there,

have you found out how to rotate shapes? Especially by dropping and connecting them after it would be interesting to know.

I need some reference as well, and couldnt find anything except for some similar but for me not so helpful post (http://visguy.com/vgforum/index.php?topic=45.0).
Title: Re: C# Project: how to rotate shapes and get data from them
Post by: Nikolay on August 08, 2009, 06:45:12 PM
It seems that the (referenced) post about groups discusses something tricky; probably you need just a basic idea of "how do I rotate a shape"?

"Rotate" a shape 45 degrees:

shape.Cells("Angle").Formula = "45 deg";


Probably that's it?
Actually this code not exactly "rotates" a shape but sets it's angle to 45 degrees.
But it illustrates the basic idea that shape rotation can be done by setting the shape's angle.

Unfortunately I didn't quite get what did you mean by "rotating shapes by dropping them"...  ???

Cheers, Nikolay.