From SW API Help it is called a Mark.
Value that you want to use as a mark; this value is used by other functions that require ordered selection
Thanks for the response.
But Im still confused about the ordered selection.
For example when I select a Line using the code below, when will I know that I need to use 0?
swDocOwner.Extension.SelectByID2("Line1", "SKETCHSEGMENT", 0, 0, 0, false, 0, null, 0);
Thanks in advance.
2 people found this helpful
I have been wondering this as well... Some functions requires orders selection and then you use mark. See the Remarks for this function as reference.
So I would assume that you could set any mark if not the function that will use the selection have specified any specific marks. But keep it simple since the mark may be used in the GetSelectedObject6 method.... therefore I
Further reference about selection list and the behavior of using marks is found here.
I just read this myself and remembered this post. Thought I'd share it since it made things more clear to me.
4 people found this helpful
When you programmatically select an entity, you are given the ability to mark that selected entity with a number so that other functions can differentiate between the purpose off each selection.
For example, consider a circular pattern feature. In the GUI, you have to make two selections if you want to pattern a feature:
1. An axis selection
2. Feature selections
Both of these selections are a precondition for the creation of the circular pattern. Likewise, these selections are a precondition when using IFeatureManager::FeatureCircularPatternX.
In the GUI, you specify which selection is the axis and which is the feature(s) simply by giving the correct PropertyManager page selection box focus before selecting.
In the API, there is no GUI obviously, so you mimic picking which selection box to add the selection to by specifying a mark. Again, the mark is simply an integer. In our case, since we're trying to create a circular pattern with IFeatureManager::FeatureCircularPattern4, we simply go to the API Help page for that API call and we read this:
Therefore, our code to make the proper selections will look like this (as long as your IModelDoc2 variables is named swModel):
swModel.Extension.SelectByID2 "Axis1", "AXIS", 0, 0, 0, False, 1, Nothing, 0
swModel.Extension.SelectByID2 "Boss-Extrude2", "BODYFEATURE", 0, 0, 0, True, 4, Nothing, 0
Also note that the order is not usually important, though there are some exceptions. You should be able to select the items in any order, and as long as you apply the correct mark, the API call requiring the marks should make sense of the selections.
I hope this helps.
Hi Keith and Daniel, thanks for you inputs and sharing your knowledge.
Thank you very much for explaining it well.
It was a big help.
God bless everyone.