I have a set of drawing documents that will not load properly under the following statement:
Set swDrawModel = swApp.OpenDoc6(S, swDocDRAWING, swOpenDocOptions_Silent + swOpenDocOptions_RapidDraft, Empty, nErrors, nWarnings)
Under these circumstances, there are no errors or warnings set, even though the object pointer swDrawModel = Nothing.
The contradiction to this is that the same code will execute properly (i.e., not come back with a null pointer) on a different set of drawings. The difference between the functioning and broken drawing sets appears to be a assembly versus a part only for the model reference.
By the way, I able to load all drawing sets (properly) in the solidworks manager, as detached, without issue. If I save the broken drawing as detached, then it will load in the above macro (which is not the desired workflow!).
Running SW2015, sp 2.1
SolidworksApi macros