.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Rotate with arguments ?

4 REPLIES 4
Reply
Message 1 of 5
jgarciaanton
217 Views, 4 Replies

Rotate with arguments ?

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.
4 REPLIES 4
Message 2 of 5
Anonymous
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.
Message 3 of 5
jgarciaanton
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.
Message 4 of 5
jgarciaanton
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.
Message 5 of 5
Anonymous
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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost