Inventor General Discussion

Inventor General Discussion

Reply
Distinguished Contributor
zdhrichard
Posts: 128
Registered: ‎05-03-2011
Message 1 of 30 (262 Views)

Does anybody know how to close an application (*.ipt & *.iam) by ilogic code?

262 Views, 29 Replies
03-26-2013 05:03 AM

Does anybody know how to close an application (*.ipt & *.iam) by ilogic code?

 

I tried to use

           ThisDoc.Document.close (True)

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?

Rich

Autodesk Inventor Professional 2014 (64 Bit Edition)
Build: 246, Release 2014 SP2 Update 2
Windows 7 Professional Service Pack 1
Intel(R) Xeon(R) CPU E5645
12.0 GB Memory
*Pro
jletcher
Posts: 1,983
Registered: ‎05-18-2011
Message 2 of 30 (251 Views)

Re: Does anybody know how to close an application (*.ipt & *.iam) by ilogic

03-26-2013 05:28 AM in reply to: zdhrichard

Do you want to close Inventor or just close the part?


Please mark this response as "Accept as Solution" if it answers your question.

James Letcher
2012 Factory Design Suite ( will not load 2013)
What happen to my Inventor :-(
Distinguished Contributor
zdhrichard
Posts: 128
Registered: ‎05-03-2011
Message 3 of 30 (246 Views)

Re: Does anybody know how to close an application (*.ipt & *.iam) by ilogic

03-26-2013 05:37 AM in reply to: jletcher

Just *.ipt or *.iam.

Rich

Autodesk Inventor Professional 2014 (64 Bit Edition)
Build: 246, Release 2014 SP2 Update 2
Windows 7 Professional Service Pack 1
Intel(R) Xeon(R) CPU E5645
12.0 GB Memory
*Pro
jletcher
Posts: 1,983
Registered: ‎05-18-2011
Message 4 of 30 (234 Views)

Re: Does anybody know how to close an application (*.ipt & *.iam) by ilogic

03-26-2013 05:56 AM in reply to: zdhrichard

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.

 

 

 


Please mark this response as "Accept as Solution" if it answers your question.

James Letcher
2012 Factory Design Suite ( will not load 2013)
What happen to my Inventor :-(
Distinguished Contributor
zdhrichard
Posts: 128
Registered: ‎05-03-2011
Message 5 of 30 (227 Views)

Re: Does anybody know how to close an application (*.ipt & *.iam) by ilogic

03-26-2013 06:06 AM in reply to: jletcher

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

         ThisApplication.Quit

But it is better just close the parent-model instead of Inventor.

Do you know any code can do this way?

Rich

Autodesk Inventor Professional 2014 (64 Bit Edition)
Build: 246, Release 2014 SP2 Update 2
Windows 7 Professional Service Pack 1
Intel(R) Xeon(R) CPU E5645
12.0 GB Memory
*Pro
jletcher
Posts: 1,983
Registered: ‎05-18-2011
Message 6 of 30 (220 Views)

Re: Does anybody know how to close an application (*.ipt & *.iam) by ilogic

03-26-2013 06:23 AM in reply to: zdhrichard

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.

 


Please mark this response as "Accept as Solution" if it answers your question.

James Letcher
2012 Factory Design Suite ( will not load 2013)
What happen to my Inventor :-(
*Pro
jletcher
Posts: 1,983
Registered: ‎05-18-2011
Message 7 of 30 (218 Views)

Re: Does anybody know how to close an application (*.ipt & *.iam) by ilogic

03-26-2013 06:26 AM in reply to: jletcher

Or try this

 

oPartDoc.Close

 

 

 


Please mark this response as "Accept as Solution" if it answers your question.

James Letcher
2012 Factory Design Suite ( will not load 2013)
What happen to my Inventor :-(
Distinguished Contributor
zdhrichard
Posts: 128
Registered: ‎05-03-2011
Message 8 of 30 (213 Views)

Re: Does anybody know how to close an application (*.ipt & *.iam) by ilogic

03-26-2013 06:33 AM in reply to: jletcher

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.

Rich

Autodesk Inventor Professional 2014 (64 Bit Edition)
Build: 246, Release 2014 SP2 Update 2
Windows 7 Professional Service Pack 1
Intel(R) Xeon(R) CPU E5645
12.0 GB Memory
Distinguished Contributor
zdhrichard
Posts: 128
Registered: ‎05-03-2011
Message 9 of 30 (212 Views)

Re: Does anybody know how to close an application (*.ipt & *.iam) by ilogic

03-26-2013 06:35 AM in reply to: jletcher

Hello James,

 

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?

Rich

Autodesk Inventor Professional 2014 (64 Bit Edition)
Build: 246, Release 2014 SP2 Update 2
Windows 7 Professional Service Pack 1
Intel(R) Xeon(R) CPU E5645
12.0 GB Memory
*Pro
jletcher
Posts: 1,983
Registered: ‎05-18-2011
Message 10 of 30 (201 Views)

Re: Does anybody know how to close an application (*.ipt & *.iam) by ilogic

03-26-2013 06:44 AM in reply to: zdhrichard
Dim oPartDoc As PartDocument

 


Please mark this response as "Accept as Solution" if it answers your question.

James Letcher
2012 Factory Design Suite ( will not load 2013)
What happen to my Inventor :-(
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.