I think you have to correct these lines to match the folder where you store your files
- Fold = "C:\test\" (make sure your folder name is correct)
- Set swModel = swApp.OpenDoc6(Fold + FileName, swDocPART, swOpenDocOptions_Silent, "", nErrors, nWarnings)
modify this line to
Set swModel = swApp.OpenDoc6(Fold + FileName, swDocDRAWING, swOpenDocOptions_Silent, "", nErrors, nWarnings)
Hope this helps
Thanks John, thats got the first half of it working. I'll do some reading into how to do a saveas now, although most things seem to be trying to output pdf's or step files now slddrw.
Dim nFileName As String
nFileName = Mid(swModel.GetPathName, InStrRev(swModel.GetPathName, "\") + 1)
swModelDocExt.SaveAs Fold & nFileName, swSaveAsCurrentVersion, swSaveAsOptions_Silent, Nothing, nErrors, nWarnings
If I'm interpreting this correctly it the above code should saveas the drawing with a "1" on the end of the current name, but this isn't happening and I'm not getting any errors.
My final macro will name needs to be driven by the recently updated custom properties, "GE_SSP" + "GE_DrawingNumber". If you could help me get over this final hurdle it would be very much appreciated.
Ashley, the macro won't change anything but the codes given are pulling the current name and saving as current name in the specified path.
The codes were given as example only, so you need to modify the nFileName.
If you can upload sample drawings showing before and after then it would be easy to derive/update the macro.
I've attached a stripped down drawing, which has the unchanged custom properties. I'm guess you don't need the assembly as all the custom properties are stored in the drawing.
I've also attached the marco as it currently stands.
Once the marco has updated the custom properies "GE_DrawingNumber" & "GE_Parent", we need to save the file name using "GE_SSP" & "GE_DrawingNumber". Eg file name will go from SSP12345-1-01-015.SLDDRW to SSP12345-X-01-015.SLDDRW
Hi, welcome to this forum and I'm sorry to say I did not solve your problem.