09-13-2016
06:21 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
09-13-2016
06:21 PM
What you've run into isn't a change from VBA to C# but is a change that was made in the API quite a while ago. The StartCommand method has been retired. You can still accomplish the same thing by first getting the CommandDefinition that represents the command and then executing it. Below os some sample code that demonstrates what you're trying to do.
string filename = "C:/Temp/Tests/EllipsePart.ipt"; // Post the filename to the private event queue. invApp.CommandManager.PostPrivateEvent(Inventor.PrivateEventTypeEnum.kFileNameEvent, filename); // Get the control definition for the Place Component command. Inventor.ControlDefinition ctrlDef = invApp.CommandManager.ControlDefinitions["AssemblyPlaceComponentCmd"]; // Execute the command. ctrlDef.Execute();
