Hi Nick and Welcome to the SolidWorks API Community!
I would suggest to not select by composed name. It is better to find the pointer directly. When you modifying the definition in context you should pass the pointer to component as the context object. Please find the code below which is applicable to your case.
Dim swApp As SldWorks.SldWorks
Dim swAssy As SldWorks.AssemblyDoc
Set swApp = Application.SldWorks
Set swAssy = swApp.ActiveDoc
ModifyLinPattern "NextAssembly-1", "LocalLinearPattern1"
Sub ModifyLinPattern(compName As String, pattName As String)
Dim swComp As SldWorks.Component2
Set swComp = swAssy.GetComponentByName(compName)
Dim swFeat As SldWorks.Feature
Set swFeat = swComp.FeatureByName(pattName)
Dim swFeatData As SldWorks.LocalLinearPatternFeatureData
Set swFeatData = swFeat.GetDefinition
swFeatData.AccessSelections swAssy, swComp
Dim skipArr(1) As Long
skipArr(0) = 1: skipArr(1) = 3
swFeatData.SkippedItemArray = skipArr
swFeat.ModifyDefinition swFeatData, swAssy, swComp
Regards, Artem Taturevych | Snr. Developer | IC3D ANZ
IC3DSteel – New Steel Solution for SolidWorks
translationXpert – SolidWorks files language translator
Thanks for the assistance, my biggest problem was understanding the component2 method and then what the AccessSelections method wanted in terms of parameters. In addition to this, I saw that the Modify Definition should automatically release the selection, and I added the release selection after that anyway, but in the model after my code runs, the subassembly is still "Open" for editing. Is there a way to have it "close" for editing. Not sure if I'm making sense here, but basically it leaves it where the SubAssembly is Opened and I want it closed after the code runs.
Other than that the model is updating as it should. Thanks again!
I got it by calline Part.EditAssembly and that took me back to the top level assembly.