Using REVCLOUD with Editor.Command()

Using REVCLOUD with Editor.Command()

tvhlong93
Contributor Contributor
1,925 Views
10 Replies
Message 1 of 11

Using REVCLOUD with Editor.Command()

tvhlong93
Contributor
Contributor

Hi,

 

I need to use the REVCLOUD command via .NET. But when I use the command by Editor.Command(), it has different options between using the REVCLOUD command in AutoCAD.

Why are the options different? And how can I get all the options? Please help me with this problem. Thank you.

 

tvhlong93_0-1693379006630.png

Command: MYCOMMAND

Minimum arc length: 0.5000 Maximum arc length: 0.5000 Style: Normal Type: Freehand
Specify start point or [Arc length/Object/Style] <Object>: *Cancel*

Select insertion point: *Cancel*

 

Command: REVCLOUD

Minimum arc length: 12.0000 Maximum arc length: 12.0000 Style: Normal Type: Rectangular
Specify first corner point or [Arc length/Object/Rectangular/Polygonal/Freehand/Style/Modify] <Object>: *Cancel*

0 Likes
Accepted solutions (1)
1,926 Views
10 Replies
Replies (10)
Message 2 of 11

Virupaksha_aithal
Autodesk Support
Autodesk Support

Hi,

 

can you please share the code which can be used to reproduce the issue..like

 

[CommandMethod("testREVCLOUD")]
public void testREVCLOUD()
{
Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
ed.Command("_.REVCLOUD", "_Arc", 4.0, 4.0);

}



Virupaksha Aithal KM
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 11

tvhlong93
Contributor
Contributor

Sorry for the late response. Here's the code.

[CommandMethod("MYCOMMAND")]
public static void TestRevCloud()
{
    Document doc = acApp.DocumentManager.MdiActiveDocument;
    Database db = doc.Database;
    Editor ed = doc.Editor;
    double scale = 12;
    ed.Command("_.REVCLOUD", "_ARC", 0.25 * scale, 0.25 * scale);
}

 

This is message when I use the "MYCOMMAND"

Command: MYCOMMAND

Minimum arc length: 0.5000 Maximum arc length: 0.5000 Style: Normal Type: Freehand
Specify start point or [Arc length/Object/Style] <Object>: *Cancel*

 

The following message is when I use the "REVCLOUD" which is the AutoCAD command

Command: REVCLOUD

Minimum arc length: 0.5000 Maximum arc length: 0.5000 Style: Normal Type: Rectangular
Specify first corner point or [Arc length/Object/Rectangular/Polygonal/Freehand/Style/Modify] <Object>: *Cancel*

 

They show different options when picking a point and the command sent through Editor.Command doesn't have options like "Rectangular", "Polygonal",.. and it forces the user to use the "Freehand" type only.

0 Likes
Message 4 of 11

Virupaksha_aithal
Autodesk Support
Autodesk Support

Hi,

 

not sure why you are getting the mentioned results in AutoCAD. I am attaching the output of your code at my end.autocad_commandline.png 



Virupaksha Aithal KM
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 5 of 11

tvhlong93
Contributor
Contributor

Yes, the command only has three options: [Arc length/Object/Style]. Options in the image are missing (in red color).

 

tvhlong93_0-1694479797696.png

 

I want my custom command to act like a normal REVCLOUD command which has full option.
For more information, I am referring to AutoCAD 2020 API. 

0 Likes
Message 6 of 11

Virupaksha_aithal
Autodesk Support
Autodesk Support

Thanks for the image. Try SendStringToExecute API. This API normally simulates AutoCAD UI behavior. 

Note : SendStringToExecute works asynchronously .



Virupaksha Aithal KM
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 7 of 11

Alexander.Rivilis
Mentor
Mentor
Accepted solution

You can try set Editor.InitCommandVersion

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

0 Likes
Message 8 of 11

tvhlong93
Contributor
Contributor
I still have some code after that so I skip this method at the start. The answer of Alexander.Rivilis has solved this problem with Editor.InitCommandVersion(2).
Thank you for your support.
Message 9 of 11

tvhlong93
Contributor
Contributor

Thank you very much.
Do you have any information about the input version, please send me the document about it for reference if you have one. I can only find the information below but it doesn't help much. Anyway, I tried with Editor.InitCommandVersion(2) and it worked as expected.

tvhlong93_0-1694507978115.png

 

 

0 Likes
Message 10 of 11

Alexander.Rivilis
Mentor
Mentor

@tvhlong93 

Sorry, but there is no other (public) document, which describe using this method.

Also read this post: https://adndevblog.typepad.com/autocad/2015/10/creating-a-rectangular-revcloud-using-acedcommands.ht...

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 11 of 11

tvhlong93
Contributor
Contributor
Thank you. I get the ideas.
0 Likes