Hi all,
I'm creating envelopes on the fly through the API based on bounding box of a component (plus an expansion dimension). The goal is to use that envelope to hide components outside that of that envelope and save an EASM of the results. We want to use this method for our production team to review models with a focus on the item being reviewed and it's environment.
I think I've run into a wall with the selection process. I am typically pretty good searching the web and the help file to find a solution, but I'm stumped. All I can really find on this is the runcommand "swCommands_Hide_Zone" but this just fires off a dialog box that I can't automate my way through.
Am I missing something simple? Is there a method of selecting items outside my envelope?
Kevin Hill
SolidworksApi/macros
Kevin, look into the IAdvancedSelectionCriteria Interface.
thanks Wayne!
I have been sidetracked by another project. I'll hopefully get to test this out soon.
I done some more testing and found the condition for Envelope Selection.
is inside = &H20 or 32
is crossing = &H40 or 64
is outside = &H80 or 128
If you want to load a saved xml query file, this is what it should look like.
"Or" "Envelope Select -- SW Special" "is crossing" "EnvelopePart-1"
I have made some progress with this. Only issue is with the swAdvSelectType_e enumeration for the envelope select conditions. Does_Not_Interfere_With is closest I can find for is outside.
AddRetVal = AdvancedSelectionCriteria.AddItem("Envelope Select -- SW Special", &H80, "EnvelopePart-1", False) Where the envelope part in the assembly is the first instance of part "EnvelopePart".
Thanks Wayne. I'll look into it some more. Last time I tried that function, I had all sorts of issues. It seems like the documentation never kept up with the switch from sqy to xml. The example code points to an old sqy method but I couldn't find an sqy example to get the proper syntax to test.