AnsweredAssumed Answered

SW2016 modeldoc2.getnext not working...

Question asked by Jacob Kuznicki on Apr 27, 2016
Latest reply on Apr 27, 2016 by Jacob Kuznicki

I am running Soldiworks 2016 SP2.0, and I have macros that our company has written that use the ModelDoc2.GetNext method to gather a list of all open documents in Solidworks.  However the method is not returning the expected next ModelDoc2 object.  The following example code is returning the active model but none of the subsequent "open" models.  I would like to note that this was working in previous versions of Solidworks.

 

VB.Net Example:

Dim sw As sldworks.SldWorks = CreateObject("SldWorks.Application")

Dim swModel As ModelDoc2 = swApp.ActiveDoc

 

If Not swModel Is Nothing Then

  Do While Not swModel Is Nothing

    'Add model to List

    swModel = swModel.GetNext

  Loop

End If

Outcomes