Author Topic: Non Public Method moved?  (Read 1760 times)

0 Members and 1 Guest are viewing this topic.

TJK44

  • Guest
Non Public Method moved?
« on: September 24, 2014, 09:46:50 AM »
Hi all,

Does anyone know if the non public method RunCommand is no longer a method in the Editor object? The below code line now returns Nothing in AutoCAD 2015, but is fine in 2014. Any ideas?

Code - Visual Basic: [Select]
  1. Dim runCommand As MethodInfo = GetType(Editor).GetMethod("RunCommand", BindingFlags.Instance Or BindingFlags.NonPublic Or BindingFlags.Public)

Thanks,

Ted

EDIT:

I was accidentally referencing 2014 DLLs in my project and this was another project created using the wizard. I had to create a new project because the 2015 DLLs need the project to target .NET 4.5. When I changed the old project from .NET 4 to 4.5 I got some ambiguity errors which I think are a result of using the AutoCAD wizard.
« Last Edit: September 24, 2014, 10:34:36 AM by TJK44 »

BlackBox

  • King Gator
  • Posts: 3770
Re: Non Public Method moved?
« Reply #1 on: September 24, 2014, 10:53:15 AM »
Hi all,

Does anyone know if the non public method RunCommand is no longer a method in the Editor object? The below code line now returns Nothing in AutoCAD 2015, but is fine in 2014. Any ideas?

Code - Visual Basic: [Select]
  1. Dim runCommand As MethodInfo = GetType(Editor).GetMethod("RunCommand", BindingFlags.Instance Or BindingFlags.NonPublic Or BindingFlags.Public)

Thanks,

Ted

EDIT:

I was accidentally referencing 2014 DLLs in my project and this was another project created using the wizard. I had to create a new project because the 2015 DLLs need the project to target .NET 4.5. When I changed the old project from .NET 4 to 4.5 I got some ambiguity errors which I think are a result of using the AutoCAD wizard.

2015 API has changed from 2014 API, so you may actually need to implement an Imports/using declaration to avoid namespace qualification.

You can change your project to target 4.5; you may just need to also update some references, is all.

Also, in 2015 you can use the new Editor.Command() subroutine and Editor.CommandAsync(…) coroutines.

Cheers



[Edit] - Adding link for reference:
http://knowledge.autodesk.com/support/autocad/learn-explore/caas/blog/through-the-interface.typepad.com/through_the_interface/2014/03/autocad-2015-calling-commands.html
"How we think determines what we do, and what we do determines what we get."