Closed ghost closed 6 years ago
It will work with,
branch.Select(1);
But this is obsolete now.
First of all, is there some reason why you call branch.Select()
in a loop? You will not see intermediate results anyway - all you will see is the last branch selected.
Anyway, I tried to reproduce the issue you report using SDK package from https://github.com/walkinside/sdk/releases/tag/from-10.2.35. I used Example 3 and added the following lines to the form's constructor:
var branches = SDKViewer.ProjectManager.CurrentProject.BranchManager
.GetBranchesByNameFragmentAndKind("BASE_SLAB", VRBranchKind.Cad);
foreach (IVRBranch branch in branches)
{
branch.Select();
}
I ran it on example Stabilizer project from the Walkinside package. There were no errors.
I suspect some important details are missing from your report, like the fact that you use threads or background workers.
Could you take "Example 3" and modify it until you reproduce the issue in example Stabilizer project, then share those changes with us?
Reason behind of calling branch.Select()
in loop is, defined or required value to be searched. Not to get list of values.
Is different from version to version? am using COMOS Walkinside 10.2.34.46.
Will check with Example 3 as suggested and update.
Thank you. Once we have the complete minimal code and data to trigger this error, we can debug the issue much faster.
Good to hear, :)
Any other way to select branch. Please suggest. Thanks
Hi @dkOogway, another way that might be good for your use case is using IVRGroupExtensions.Highlight() helper. This will apply style and color to a group of branches but won't trigger selection events. We are closing the issue but feel free to reopen it if it doesn't fit your needs.
Hi,
I can retrieve list of branch using below code,
Output,
But i couldn't select the defined branch in CAD hierachy with below,
Error,
Could anyone please tell how to select the branch?
Thanks,