ds-blue-logo
Preview  |  SOLIDWORKS USER FORUM
Use your SOLIDWORKS ID or 3DEXPERIENCE ID to log in.
CPCody Pannell02/04/2021

Hey guys-

I'm still new to writing macros, but am trying to make my life easier. 

In an assembly, I have two sketch planes inside of a 3D sketch inside of part 1. I'm trying to select and generate an intersection curve between those two sketch planes, and a pair of faces that lie on part 2. I have named the faces I want to select inside part 2 (Face1 and Face2). Currently, it will edit the 3D sketch of part 1 and select the two 3D sketch planes, but I can't get it to select the two faces on part 2. I've tried using SelectByID2("Face1@Part 2-1@Main Assembly", "FACE", 0, 0, 0, True, 0, Nothing, 0), but it doesn't select anything. When I record the steps, it selects the faces with coordinates, and I need it to select with the name because the position of these faces can change. 

So, my question is: when inside an assembly, is there a way to select named faces outside of the part you're currently editing?