Good Morning,
I am trying to write an external iLogic rule that will export the unfolded model of a sheet metal part in a drawing from a rule triggered in the .idw. These drawings will contain only one model reference. The reason for doing this from the drawing are as follows:
1) The location of the resulting .stp file must be the same directory as the .idw file. our file structure does not co-locate these files so the drawing path is required to locate the .stp file.
2) The current Drawing Rev level is to appended to the .stp file name. We do not populate the Rev iProperty in the part.
I have scabbed together some code from verious deep dark corners on the internet and Have arrived at the code posted below, but It errors during the .stp file creation with the following:
Error Message:
Error in rule: STEP Export With Rev, in document: 4000401-02 Blank Pattern.idw
Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
More Info:
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.FlatPattern.Edit()
at LmiRuleScript.Main()
at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
at iLogic.RuleEvalContainer.ExecRuleEval(String execRule).
I have attached the rule in question in case the formating flakes out...
This is a big deal for us as we have made lots of scrap due to our laser vendor cutting out of date files. Any help here would Greatly Appreciated.
Regards,
Thomas Ruscher
Project Engineer
TJ Hale Co.
Hi Thomas,
I tried this and only got a step file in folded format. It is the same like you export from part document from the menu.
Regards
Cean