Save As "TwinHex_SUB.ipt" not "Part 10 cannot be overwritten"?

Save As "TwinHex_SUB.ipt" not "Part 10 cannot be overwritten"?

andrew_canfield
Collaborator Collaborator
259 Views
2 Replies
Message 1 of 3

Save As "TwinHex_SUB.ipt" not "Part 10 cannot be overwritten"?

andrew_canfield
Collaborator
Collaborator

 

 

 

Typo found

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

JelteDeJong
Mentor
Mentor
Accepted solution

Multiple things are wrong here.

JelteDeJong_0-1645729805886.png

Try this for the sub SaveFile(...)

    Sub SaveFile(oDoc As Document, NewFileName As String)

        If (System.IO.File.Exists(NewFileName)) Then
            MsgBox(NewFileName & " already exists. cant save now...")
            Return
        End If
        Try
            oDoc.SaveAs(NewFileName, False)
        Catch ex As Exception
            MsgBox("Something went wrong while saving file: " & NewFileName)
        End Try

    End Sub

 

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes
Message 3 of 3

andrew_canfield
Collaborator
Collaborator

Thankyou - it has helped but I'm seeing odd glitches.

I will upload the test files because it's complicated (for me anyway), the idea is:

  1. ExcelSwap3 is a holding assembly with reads the file path (to be exported from a BoM if/when working)
  2. ReplaceX is the excel file holding the file paths & browser names
  3. Represent complicated sub-assemblies
  4. these have been created by the current code 
  5. very odd but there should be two cones.

Files.jpg

Overview: Replace.png

 

The 'Glitches' are these messages but the parts are still created?

WarningSave.JPG

 

Note the 3 bought out parts in the zipped up attachment have the End of Part marker pulled up to reduce the file size.

 

The Blocks are to represent small detailed parts (BoP's) possibly not required on a drawing at a 100:1 scale but the code replaces these with a bounding box (size setting in rule) - think it's better to see there's something there rather than omit them.

The same excel file can then be used to swap the 'Full Fat' sub assemblies with the 'Substitute' files without the need for a Level of Detail (hopefully this will help the processing as less files will be retrieved by the data management system). 

The simplified sub assemblies appear like this - with blocks replacing the BoP's, Simplified.JPG

 

Any help appreciated - I've been chipping away at this for a while & think it's pretty close to working.

Regards

 

Andrew

 

 

0 Likes