.NET

Reply
Contributor
20 Posts
0 Kudos
Registered: ‎08-23-2006
Post 1 of 5

Rotate with arguments ?

87 Views, 4 Replies
11-23-2006 08:26 AM
Hi all,

I would like to create a button on a toolbar than when clicked
rotates a block, using the autoCAD rotate command,
but without having the user select the objects to rotate.

My guess is that I might be able to use the SendCommand
or P/Invoke to call the rotate command, but "passing the
block as an argument" as the object to rotate, and just
let the user choose the angle as the rotate command does.
Does anyone know if this is possible ?

Thanks in advance

j.
*Tony Tanzillo
Post 2 of 5

Re: Rotate with arguments ?

11-23-2006 02:19 PM in reply to: jgarciaanton
Have you done much AutoCAD programming or any kind of programming in .NET?

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

wrote in message news:5405317@discussion.autodesk.com...
Hi all,

I would like to create a button on a toolbar than when clicked
rotates a block, using the autoCAD rotate command,
but without having the user select the objects to rotate.

My guess is that I might be able to use the SendCommand
or P/Invoke to call the rotate command, but "passing the
block as an argument" as the object to rotate, and just
let the user choose the angle as the rotate command does.
Does anyone know if this is possible ?

Thanks in advance

j.
Contributor
20 Posts
0 Kudos
Registered: ‎08-23-2006
Post 3 of 5

Re: Rotate with arguments ?

11-24-2006 07:53 AM in reply to: jgarciaanton
Hi Tony,

I have done a reasonable amount of programming in .NET,
and would consider myself close to intermediate level.

On the other hand, I am fairly new to AutoCAD programming
but I have managed to obtain some results with the help
of this forum.

For my current project it would be key to be to able to rotate
a block in the way AutoCAD 2007 rotate command does it. (i.e. using
the rubber band to control the angle), but without the need to define
which objects to rotate.

Its only in doing the rotating which I need help with, not creating the button.

Thanks in advance,

j.
Contributor
20 Posts
0 Kudos
Registered: ‎08-23-2006
Post 4 of 5

Re: Rotate with arguments ?

12-01-2006 10:48 AM in reply to: jgarciaanton
Hi Tony,

I am still fighting this issue. By looking at other threads in this forum,
I have found and implemented your code at http://www.caddzone.com/CommandLine.cs


I have created a method in order to rotate the entity.

public static int RotateSquare(ObjectId square, Point3d basepoint)
{
//return Command("._ROTATE", square, basepoint);
return Command("._ROTATE", square, basepoint, "");
}

When I execute it, Acad 2007 has correctly selected the object to rotate, but still
prompts me to specify the base point about which to rotate the object.


Do you know how I could resolve this ?

Thanks in advance
j.
*Tony Tanzillo
Post 5 of 5

Re: Rotate with arguments ?

12-01-2006 01:15 PM in reply to: jgarciaanton
The rotate command prompts for multiple objects,
so you must terminate object selection with an empty
string first, before you supply the basepoint:

Command("._ROTATE", square, "", basepoint, ...);

Also remember that you must provide all input to the
command, you can't leave it in progress when your
own registered command handler terminates.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

wrote in message news:5412292@discussion.autodesk.com...
Hi Tony,

I am still fighting this issue. By looking at other threads in this forum,
I have found and implemented your code at http://www.caddzone.com/CommandLine.cs


I have created a method in order to rotate the entity.

public static int RotateSquare(ObjectId square, Point3d basepoint)
{
//return Command("._ROTATE", square, basepoint);
return Command("._ROTATE", square, basepoint, "");
}

When I execute it, Acad 2007 has correctly selected the object to rotate, but still
prompts me to specify the base point about which to rotate the object.


Do you know how I could resolve this ?

Thanks in advance
j.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!