cancel
Showing results for 
Search instead for 
Did you mean: 

Filtering Duplicate items while user selects an object twice (Block Styler :: SelectObject)

Pioneer
Pioneer

Hi,

 

Can somebody guide me is there any option to remove an already selected item, when user selects the same item twice.

 

My Main objective is to have the selection sequence as per user selection and remove the duplicate entries if user selects the same point twice.

 

I defined Property list as a private member defined as a class member.

            this.arrPointsSelected.Clear();
            this.blkSelPoints_Properties = null;

            this.blkSelPoints_Properties = blkSelectPoints.GetProperties();
            this.blkSelPoints_Properties.GetPropertyNames();

            TaggedObject[] tagObjVect_SelectedPoints = blkSelPoints_Properties.GetTaggedObjectVector("SelectedObjects");
            string sPointName = null;
            Boolean bAlreadySelected = false;

            for (int i = 0; i < tagObjVect_SelectedPoints.Length; i++)
            {
                Point point = (Point)tagObjVect_SelectedPoints[i];
                sPointName += "\n" + point.Name + " :: " + point.Tag;

                point.Highlight();

                for (int j = 0; j < tagObjVect_SelectedPoints.Length; j++)
                {
                    Point point2 = (Point)tagObjVect_SelectedPoints[j];
                    if (point.Equals(point2))
                        bAlreadySelected = true;
                    else
                        bAlreadySelected = false;
                }
                if (!bAlreadySelected)
                    this.arrPointsSelected.Add(point);
                
            }
            the_UI.NXMessageBox.Show("Points" , 
                                     NXMessageBox.DialogType.Information,
                                     "Points Selected Sequence : \n" + sPointName);
        }

 

I tried to check TAGs old selection and new selection.  

 

Attached is the snap of the result whic hi got from selection.

 

Regards,

Maddy

 

Windows 7 x64
NX 8.5, NX 9.0. And also NX 7.5
Visual Studio 2010 SP1, 2012 Update 4
6 REPLIES

Re: Filtering Duplicate items while user selects an object twice (Block Styler :: SelectObject)

Siemens Phenom Siemens Phenom
Siemens Phenom

 

Maddy,

 

In general, you should not be able to select any object that is already selected.  It is hard to tell for sure, but from your picture it looks like you have more than one point called Point(2).

 

If you hover over those with the cursor for a few seconds, do you see the "..." for the quick pick menu?

 

Steve

 

Re: Filtering Duplicate items while user selects an object twice (Block Styler :: SelectObject)

Experimenter
Experimenter

Hi Steve,

 

Yes, In concept we should not be able to select same point twice, but i can select the same point twice. 

I have created those 5 different points in a new part file using Coordinates method and named them ( Renaming is for verification whether the same point selected will be shown in the selected objects or not)

 

(There is a private PropertyList blkSelPoints_Properties as a class member not inside call back, but its getting reset everytime to null as you can see in code

            this.blkSelPoints_Properties = null;

)

 

Regards,

Maddy

 

Re: Filtering Duplicate items while user selects an object twice (Block Styler :: SelectObject)

Experimenter
Experimenter
Hi

i cant understand, how my reply came got CodeBreaker's Name

Regards,
Maddy

Re: Filtering Duplicate items while user selects an object twice (Block Styler :: SelectObject)

Pioneer
Pioneer

Hi Steve, 

 

I tried with different file and differenct points, it is working as intened.

 

Got it, I was modifying an existing code and in some place there were some temporary points created in code at same place.

 

Thanks for suggesion steve.

 

Regards.

Mahadev

Windows 7 x64
NX 8.5, NX 9.0. And also NX 7.5
Visual Studio 2010 SP1, 2012 Update 4

Re: Filtering Duplicate items while user selects an object twice (Block Styler :: SelectObject)

Pioneer
Pioneer

Hi, 

Sorry again, i tried to select the points from a part file and it was not accepting the same point twice.

where as if we add this point file to an assembly file, we can select the same point twice or more.

 

Im getting confused in this case.

 

Can anybody explain how this is possible?.

 

Regards,

Maddy

 

 

Windows 7 x64
NX 8.5, NX 9.0. And also NX 7.5
Visual Studio 2010 SP1, 2012 Update 4

Re: Filtering Duplicate items while user selects an object twice (Block Styler :: SelectObject)

Esteemed Contributor
Esteemed Contributor

In an assembly the selection scope is important.

You can select the component, the instance of the point and the original point in the component, so there are multiple representations of the same object available.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community