- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I am looking for a command or code to copy an external file using ilogic. To clarify this issue, I want to tell you my case. I have an ipart in a folder that this ipart has a drawing with the same name in this folder. I have written a code to save a copy from this ipart with a new name but i want simultaneously to copy the drawing with the new name of ipart. Until now I have all of the addresses for new drawing including path and file name with the extension but I don't know how to copy it. I don't want to open the drawing and then save a copy. my code is as follows:
thanks.
oFileName = ThisDoc.FileName(False) 'without extension
'Craeting New File Do oNewPartName = InputBox("Please give complete name for the new file" , "CheckBox", "") oNewPartNumber=Left(oNewPartName,8) oCheck = Left(Mid(oNewPartName, 9), 1) If oCheck = "_" And IsNumeric(oNewPartNumber) = True Then Exit Do Else End If Loop 'Save New File FileToSave = ThisDoc.Path & "\" & oNewPartName & ".ipt" 'Copy Drawing 'Path of the original Drawing Dim oOrigPath As String = ThisDoc.Path 'Name of the original Drawing Dim oOrigName As String=ThisDoc.Path & "\" & oFileName & ".dwg" 'Path of the new Drawing Dim oNewPath As String = ThisDoc.Path 'Name of the new Drawing Dim oNewName As String = ThisDoc.Path & "\" & oNewPartName & ".dwg" If (System.IO.File.Exists(oOrigName)) = True Then 'I want to copy oNewName in the same folder of oOrigName??????? Else
Messagebox.Show("There is no Drawing for this Part") End If
Solved! Go to Solution.