Hey, I believe there's an issue in the "Document.Save" command, as I believe it's supposed to pop up the regular "Save dialog" if it's a new document.
@ekinsb, @adam.nagy Can any of you guys please confirm if this is a bug or the command serves only to save already saved documents. I've tested it on 2016, Build 138 and I'll try it on 2017 tomorrow at work. Thanks.
It did the same to me (showed the same error).
However, you can try this command instead:
ThisApplication.CommandManager.StartCommand(CommandIDEnum.kFileSaveCommand)
Here's the second page of the error:
System.Runtime.InteropServices.COMException (0x80004005): Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
at Inventor._DocumentClass.Save()
at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)
Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods