AnsweredAssumed Answered

SaveAs3 Modifying Layer States During Execution

Question asked by Steven Pybus on Jun 25, 2015
Latest reply on Sep 18, 2015 by Tapani Sjoman

I've got a macro that we've been using for years that will create a DXF and a PDF out on a server drive.  I'm sure it started with code from this forum but has grown over the years to be very custom for our company.

 

I've trimmed out a bunch of other stuff but the important lines are these.

 

Dim swApp As SldWorks.SldWorks

Dim Part As ModelDoc2

Dim boolstatus As Boolean

Dim longstatus As Long, longwarnings As Long

 

Set swApp = Application.SldWorks

Set Part = swApp.ActiveDoc

 

Sub main()

    longstatus = Part.SaveAs3("I:\DXF\filename.DXF", 0, 0)

    longstatus = Part.SaveAs3("I:\PDF\filename.PDF", 0, 0)

End Sub

 

For some reason the SaveAs3 to a PDF is messing with the active layers. I'm debugging the macro line by line and the layer modification happens exactly when it hits the line above in bold.  Here are before and after of the layer settings on a sample drawing....

 

Before:

2015-06-25_1748.png

 

After:

2015-06-25_1748_001.png

 

We upgraded our EPDM yesterday.  I'm not sure if that could have caused an issue.

 

I'm wondering if anyone has seen this and/or has a solution.  The DXF and PDF saveas macros are crucial to our business.  Any help would be appreciated.

Outcomes