iLogic. Copy a drawing file in one folder and save it in another folder

iLogic. Copy a drawing file in one folder and save it in another folder

smart-cad
Enthusiast Enthusiast
838 Views
4 Replies
Message 1 of 5

iLogic. Copy a drawing file in one folder and save it in another folder

smart-cad
Enthusiast
Enthusiast

Good afternoon everyone!
How can I copy a drawing file in one folder and save it in another folder?

 

Dim Filedata As String
Dim Filework As String
	
Filedata = ThisDoc.Path + "\DATA\Drawing_1.idw"
Filework = ThisDoc.Path + "\Drawing_1.idw"	
	
	

Select Case OPTION_C
	Case "OPTION-C0"
					
	InventorVb.Application.FileManager.DeleteFile(Filework)				
					
	Case "OPTION-C1"

					
	ThisApplication.Documents.Open(Filedata, False)
	ThisDoc.Document.SaveAs(Filework, True)
	ThisDoc.Document.Close(True)

	Case Else 
		'MessageBox.Show("***", "Title") 
End Select
Accepted solutions (3)
839 Views
4 Replies
Replies (4)
Message 2 of 5

WCrihfield
Mentor
Mentor
Accepted solution

You can use the following method:

 

Dim oOldNamePath As String = "C:\Temp\MyFolder\MyDrawing.idw"
Dim oNewNamePath As String = "C:\Temp\MyDrawing.idw"
System.IO.File.Copy(oOldNamePath, oNewNamePath, False)

 

System.IO.File.Copy() 

 

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.

If you want and have time, I would appreciate your Vote(s) for My IDEAS 💡or you can Explore My CONTRIBUTIONS

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 5

WCrihfield
Mentor
Mentor
Accepted solution

Here's another similar method that can be used in the same way in iLogic (vb.net):

FileIO.FileSystem.CopyFile()

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 4 of 5

smart-cad
Enthusiast
Enthusiast
Accepted solution
My.Computer.FileSystem.CopyFile(Filedata, Filework, False) - works well!
Thank you so much )))
Message 5 of 5

dusan.naus.trz
Advisor
Advisor

I love you all. I love this site. It's so inspiring. Thanks for being here guys.

0 Likes