iLogic saveas invalid argument

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey all!
I'm having some trouble narrowing down the issues with this rule. I want to be able to save whatever document is open to a certain location, with the specified filename. I havent gotten as far as to tell it where to save, but that will be next after this snag.
The problem is I keep getting this same error after rewriting the code several times. I can get it to save, but not to save as. Ive browsed through seveal forum posts and online about this and cant seem to find what is different in my code than the ones that seem to work. currently this is in a dwg file. i know dwgFName is fine because I can get it to show me the string just fine if I comment out the saveas line.
Attached is the error message,
"Error in rule: Save As PN, in document: Cube.idw.
The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))"
Here is my code -
'get model filename Dim fname As String oViewModelName = ThisApplication.ActiveDocument.ActiveSheet.DrawingViews.Item(1).ReferencedDocumentDescriptor.ReferencedFileDescriptor.FullFileName fname = System.IO.Path.GetFileName(oViewModelName) 'set dwg no PN = iProperties.Value(fname, "Project", "part number") Rev = iProperties.Value("Project", "Revision Number") iProperties.Value("Project", "part number") = PN + "-MFG " + Rev Dim dwgFName As String dwgFName = iProperties.Value("Project", "part number") ThisApplication.ActiveDocument.SaveAs(dwgFName & ".ipt", True) 'ThisDoc.Document.SaveAs("test", True) MessageBox.Show(dwgFName)
Any and all input would be much appreciated!
Thanks for your time,
D