ed.Command

ed.Command

SRSDS
Advisor Advisor
3,297 Views
10 Replies
Message 1 of 11

ed.Command

SRSDS
Advisor
Advisor

Can I ask how the ed.Command works?

 

I really need to create a cloud from a polyline  object and the simplest way I can find  is this:

 

ed.Command("_revcloud", "_arc", 2.0 / scale, 6.0 / scale, "_object", polyId, "_no")

 

Obviously sends a commands to the command line to convert it but I get an eInValidInput error.

 

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

Alexander.Rivilis
Mentor
Mentor

1. AutoCAD version?

2. ed.Command started in context of document or in context of application?

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | 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 3 of 11

SRSDS
Advisor
Advisor

2018

 

Maybe in context of application? Not entirely sure what that means

 

  Public Sub RevCloud(polyId As ObjectId, scale As Double)
        Dim doc = Application.DocumentManager.MdiActiveDocument
        Dim db = doc.Database
        Dim ed = doc.Editor
        ed.Command("_revcloud", "_arc", 2.0 / scale, 6.0 / scale, "_object", polyId, "_no")
    End Sub
0 Likes
Message 4 of 11

Alexander.Rivilis
Mentor
Mentor

@SRSDS

 

Editor.Command can not be used in application context. E.g. this method can be used in document context - only within command without SESSION flag.

 

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | 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 5 of 11

SRSDS
Advisor
Advisor

I'm still unclear on this.

 

I converted the code from this link to VB and inserted it.

 

http://www.tek1.com.au/turning-autocad-curves-revision-clouds-autocad-net-api/

 

On the line:

ed.Command("_.REVCLOUD", "", "O", "", ss, "")

 

I get an error saying 'Command' is not a member of 'Editor'.

 

 

0 Likes
Message 6 of 11

ActivistInvestor
Mentor
Mentor
Accepted solution

Then you're using an older product release.

 

Search this discussion group for "GenerateRunCommand", and you'll find an implementation for older releases that do not expose Command().

0 Likes
Message 7 of 11

SRSDS
Advisor
Advisor

That was it!

I had ACAD 2013 references.

Thank you.

 

0 Likes
Message 8 of 11

Alexander.Rivilis
Mentor
Mentor

You was talking about AutoCAD 2018 before.

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | 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 9 of 11

SRSDS
Advisor
Advisor

I wasn't thinking in the right terms. Sorry.

 

I am running AutoCAD 2018 but my project uses the reference .dll files from 2013 

0 Likes
Message 10 of 11

Alexander.Rivilis
Mentor
Mentor

@SRSDS wrote:

I wasn't thinking in the right terms. Sorry.

 

I am running AutoCAD 2018 but my project uses the reference .dll files from 2013 


It is wrong practice because some classes/methods changed, some methods removed, some methods added.

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | 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 11 of 11

_gile
Consultant
Consultant

Hi,

 

You'll have to build, at least, two different projects:

  • one project targeting AutoCAD 2013 and 2014 which uses the wrapper for RunCommand()
  • one project targeting AutoCAD 2015 and later which uses the new Editor.Command() method (because the wrapper wont work with these versions)

 



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub