Document Save As error messages
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
So I've been perusing the forums for a while and I'm having difficulty with a particular program of mine and its generating error messages, though inconsistently.
SyntaxEditor Code Snippet
ThisDoc.Save Dim FileName As String If Length > 100 FileName = "N:\Mechpart\TLONG\Reference Materials\" & CStr(PartNumber & Floor(Length) & Length_Frac & ".ipt") ThisDoc.Document.SaveAs(FileName, True) Else FileName = "N:\Mechpart\TLONG\Reference Materials\" & CStr(PartNumber & "0" & Floor(Length) & Length_Frac & ".ipt") ThisDoc.Document.SaveAs(FileName, True) End If
The basic idea is that a larger assembly is using this dynamic part and inputting it into the larger assembly when the correct version of it can't be located. Its then feeding into the dynamic part from the assembly the appropriate geometry for the part and doing a save as on the part, and then replacing the part in the assembly with the newly created version of the part.
I've narrowed it down to this rule, because I've gone into the component itself and just ran this rule individually and it gives this error alone. Most of the time it gives this error
Error in rule: Save As, in document: C15.ipt
Object of type 'System.UInt32' cannot be converted to type 'Inventor.CommandTypesEnum'.
The funny thing is the rule still actually works even though it won't let me "ok" out of the rule. I also occasionally get
Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
Though that is much more rare. The final one I get, also rare, is
The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
All of them seem to indicate to me that the program thinks it is an integer I'm trying to pass it (though I'm honestly quite new at this so I could be misreading it) and despite all attempts every now and again it will work for about 3 times straight and then break again. Any help provided would be most useful. Thank you!