File Locked Prompt after copy design with ilogic

File Locked Prompt after copy design with ilogic

mark.almack
Enthusiast Enthusiast
601 Views
5 Replies
Message 1 of 6

File Locked Prompt after copy design with ilogic

mark.almack
Enthusiast
Enthusiast

I'm using ilogic to copy a part like this:

 

oDoc = ThisApplication.Documents.Open(TemplatePart & ".ipt", False)
oDoc.SaveAs(NewName & ".ipt", False)

I want to then do something with the new file (e.g oDoc.Update), but when i do i get a prompt saying:

"'Newname.ipt' is currently locked. do you want to continue editing anyway? your changes will not get saved to the vault."

 

The new file is neither locked, nor is it in the vault!

 

Any ideas how i can get around this issue?

 

thanks

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

A.Acheson
Mentor
Mentor

Is the new file saved to a library folder which is read only? Is there a network involved as save location? Is the new name unique? Maybe try it on a new set of files not in vault!

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 3 of 6

mark.almack
Enthusiast
Enthusiast

Is the new file saved to a library folder which is read only? - No.

Is there a network involved as save location? - No.

Is the new name unique? - yes

Maybe try it on a new set of files not in vault! - well yes this works fine, but i need it to work on files that are in vault.  

I've noticed the vault browser displays the old filename greyed out and crossed out too. It's getting confused for some reason?!?

 

Regards

 

Mark

0 Likes
Message 4 of 6

Curtis_Waguespack
Consultant
Consultant

Hi @mark.almack 

 

My guess would be that the file you are opening is one that is used in an assembly that is loaded into memory... so what is happening is the assembly is seeing the file get dirtied, and things are getting a bit confused.

 

I think you can get around this, by using True rather than False for the SaveAs option, and then doing a replace in the assembly... at least that would be what I would try.

 

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

 

oDoc = ThisApplication.Documents.Open(TemplatePart & ".ipt", False)
oDoc.SaveAs(NewName & ".ipt", True)

 

EESignature

0 Likes
Message 5 of 6

Curtis_Waguespack
Consultant
Consultant
Accepted solution

And just to clarify, I think it would look something more like this, but you'll have to give it a try and see... because I'm making a bit of guess that this is the issue

 

Dim oOcc = Component.InventorComponent("Bolt 1:1")
Dim oBoltDoc As Document
oBoltDoc = oOcc.Definition.Document
sName = "C:\Temp\NewBolt.ipt"
oBoltDoc.SaveAs(sName, True)
Component.Replace("Bolt 1:1", sName, True)
  

 

EESignature

0 Likes
Message 6 of 6

mark.almack
Enthusiast
Enthusiast

Thanks,

 

Yeah that's what i've ended up doing, and it's working more reliably too.

 

Thanks

0 Likes