Open all 2d use in an IAm Save as PFD and Copy to network drev for review, how ?

Open all 2d use in an IAm Save as PFD and Copy to network drev for review, how ?

Darkforce_the_ilogic_guy
Advisor Advisor
441 Views
2 Replies
Message 1 of 3

Open all 2d use in an IAm Save as PFD and Copy to network drev for review, how ?

Darkforce_the_ilogic_guy
Advisor
Advisor

I have a code that open all Drawing run an ilogic on the now open drawing that save the idw as an PDF and close the drawing.

 

and it was find as it is now. 

 

 

The problem that I have is that I wanted to update the code so it send an copy of all the files to an network drev. So project leaders can review it 

 

 

the folder need to be somthing like this H:\Review\<Partnumber of the Iam>\*.pdf

 

the files name will be somthing like this   = <Partnumber> R<Revnummer>.pdf.

 

My program does create the files local  but it seens just not to work then I try to copy it 

 

I try using this code for copy files as the where made 

 

 

 

oRevNum = iProperties.Value(oRefDoc.DisplayName, "Project", "Revision Number")
source = "C:\BDX Manager BC\TempReviewPDF\" & iProperties.Value("Project", "Part Number") & " R" & oRevNum & ".pdf"



oPath = "H:\2e. Tegnestue\10. Drawing Review" & "\" & iProperties.Value("Project", "Part Number") & "\"
destfile = oPath & iProperties.Value(oRefDoc.DisplayName, "Project", "Part Number") & " R" & oRevNum & ".pdf"



System.IO.File.Copy(source, destfile, True)

 

the code runs , without error but no folder or files is created

 

0 Likes
Accepted solutions (1)
442 Views
2 Replies
Replies (2)
Message 2 of 3

Ralf_Krieg
Advisor
Advisor
Accepted solution

Hello

 

Afaik the Copy method doesn't create any folders in the target path that are missing. You might need to create the complete path with

System.IO.Directory.CreateDirectory(oPath)

CreateDirectory creates every Folder in the given path that is missing. Is your code enclosed by a try-catch statement that is fetching all errors? If so, try o display the upcoming error with

Try
    '... your regular code
Catch ex as exception
    MsgBox(ex.message)
End Try

R. Krieg
RKW Solutions
www.rkw-solutions.com
Message 3 of 3

Darkforce_the_ilogic_guy
Advisor
Advisor

your post kind of help me.  at less to find some of the error that was in my code thanks 

0 Likes