Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ILogic delete file in workspace

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
SoulAsasin
2284 Views, 3 Replies

ILogic delete file in workspace

Hello all,

 

Does anybody have a solution to delete a file from the workspace with a rule.

 

I have a configurator assembly full of iLogic, and i want the user to be able to rename te assembly and it's drawing in a form.

 

So i managed the save as of the assembly and it's drawing, but this way the old assembly remains in the workspace. I want to delete the old assembly and the old drawing after the renameing process.

 

i  managed to get the path of the Old files, but just couldent delete them.

 

Does anybody have a solution?

 

Thanks alot.

Inventor 2012
Win 7 64-bit
Dell Precision T5400
Intel Xeon 2,5 GHz
8 Gb RAM
NVIDIA Quadro Fx 3700
3 REPLIES 3
Message 2 of 4

Hi SoulAsasin,

 

Will something like this work?

 

 

sFile = "C:\Temp\my_File.ipt"
Try
My.Computer.FileSystem.DeleteFile(sFile)
Catch
MessageBox.Show(sFile & vblf & "    . . . can not delete file, or file not found.", "iLogic")
End Try

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

Message 3 of 4

Hey,

 

 

Works like a charm!!! Searched 3 days for something like this 🙂

Inventor 2012
Win 7 64-bit
Dell Precision T5400
Intel Xeon 2,5 GHz
8 Gb RAM
NVIDIA Quadro Fx 3700
Message 4 of 4
dusan.naus.trz
in reply to: SoulAsasin

Hi,
I'll just add another context for other searchers (innovators)
Delete file to Recycle Bin

My.Computer.FileSystem.DeleteFile(sFile, FileIO.UIOption.OnlyErrorDialogs, FileIO.RecycleOption.SendToRecycleBin)

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report