iLogic/API Notching utility behaves differently on different computers

iLogic/API Notching utility behaves differently on different computers

Anonymous
Not applicable
552 Views
5 Replies
Message 1 of 6

iLogic/API Notching utility behaves differently on different computers

Anonymous
Not applicable

I have written a rule-turned-addin that notches flat patterns at bend lines. It runs well on most machines here, but there is one machine in particular where it does not function correctly. The addin is supposed to open the part, add the notches, close the part, and move on to the next one. On this one problem machine the part does not exit flat pattern mode and the part is left open-it does move on to the next one. I am unable to replicate it on my machine and have only seen it happen occasionally on one other machine. Both machines are running Inventor Professional 2020.2.1 build 310. Windows 10 Pro versions 1909 build 18363.592 and 1903 build 18362.592 on the functioning and problem machines respectively. The problem machine claims Windows is up to date.

 

Does anybody have an idea of what could be going on? I have included a test assembly with the rule contained inside if anybody wants to test it on their machine to see what is going on. 

 

Thanks

0 Likes
Accepted solutions (1)
553 Views
5 Replies
Replies (5)
Message 2 of 6

Curtis_Waguespack
Consultant
Consultant

Hi @Anonymous 

 

Without looking at the files you provided, the thing that comes to mind from past experience is that the code is expecting to read a file name and get an extension, but the extensions are turned off on the machine in question.

 

https://www.thewindowsclub.com/show-file-extensions-in-windows

 

Edit: I had a brief look at your code, and saw the use of Displayname to get the file name... I think Displayname is where I ran into this in the past too.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

EESignature

0 Likes
Message 3 of 6

Anonymous
Not applicable

I could see this being the issue if there was an issue opening the parts, but it opens the part just fine. The same variable name is used to open the part as it is to close the part(see below). Even with the parts open it continues to open the next part in the sequence, leaving them all open. When my colleague comes back to login again I'll check it out though.

 

oDrawDoc = ThisApplication.Documents.Open(iptPathName, True)
oDrawDoc.Close

 Thanks

0 Likes
Message 4 of 6

Anonymous
Not applicable

Bump.  @johnsonshiue  any thoughts?

0 Likes
Message 5 of 6

Curtis_Waguespack
Consultant
Consultant
Accepted solution

Hi @Anonymous 

 

In your code you have a couple of Try/Catch statements where the file is to be closed, you might add a message box to display the error, so that you can see what problem is occurring on the one machine when the file doesn't close.

 

Here's an example... if you put this in a part file an error is raised because ActiveSheet is not a valid call in a part document... 

 

this version catches the error and basically silences it

Try
	oSheet = ActiveSheet.Name
Catch 
End Try

This version catches the error but tells us the problem

Try
	oSheet = ActiveSheet.Name

Catch ex As Exception
	'catch and show the error 
	MsgBox(ex.Message)
End Try

if you do something similar in your code where the close issues occurs, I think you'll be able to determine the issue.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

EESignature

0 Likes
Message 6 of 6

Anonymous
Not applicable

I had done some message boxes to try and see where the break was and nothing came up. This did show some errors but then it ran as expected. No change to the code other than the error message box. Either way thanks for the tip, I'll have to put that back into some code where I have non-specific error boxes come up.

0 Likes