Does anybody know how to close an application (*.ipt & *.iam) by ilogic code?
I tried to use
to close it.
Indeed, it can close the application, but there is an error occurred as following:
Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
Does anybody know how to avoid this error or any other way to close (or exit) the application?
Do you want to close Inventor or just close the part?
Just *.ipt or *.iam.
OK need some more info or understanding.
You have a part that has ilogic to make the part then after you make the part you want it to close?
see we have to understand your steps in what you are doing with it.
You are right.
The reason is I do not want other people see my codes.
So, I have a *.ipt (or *.iam) file with codes (we coudl call it parent-model?). When it is opened, it will start to ask user to input part number to generate the model (child-model?).
So, when child-model is generated, I will use codes to delete all rules in child-model which you and Mike help me to get this already.
Now, because I do not want the user to see my rules. So, I need close the parent-model immidiately after user get the child model.
I just get a code which could close Inventor
But it is better just close the parent-model instead of Inventor.
Do you know any code can do this way?
I think your issue may be with the ilogic code you have to delet all ilogic.
you may have to leave the ilogic that closes the main file if you are deleted them all the error is you are deleting the closed part too.
This is a guess without seeing the code you have to delete all ilogic.
Or try this
No. The iLogic code in child-model could be delete by rules already.
Now, I just want to close the parent model (*.ipt or *.iam) in order user cannot see my rules.
Thanks lot for your reply. But could you please let me know what the type of oPartDoc is? We need declare it before use it, right?
Dim oPartDoc As PartDocument
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register