@DGCSCAD - You're partly correct. Sometime this might work, but for me it didn't. If you run into a situation where you have something selected, and the Properties Palettes says nothing is selected, this would definitely be the first thing to try.
In my cases, however, (gc) did't work. In the two specific bugs I reported to Autodesk that they fixed, it didn't help. In some situations, yes, it cleans up garbage and deletes selections sets that have been released, but if the offending code doesn't actually release the selection sets, (gc) won't help.
I just confirmed this for myself with Plant 3D 2023, just to make sure. If you want to try it for yourself, it only takes a minute or two. With Plant 3D 2024.0 or earlier (it was fixed in 2024.1), create a new drawing. Draw anything, a circle for example. Select the circle. Making sure that the circle stays selected, right-click anywhere. When the context menu appears, hit ESC. Right-click anywhere. Hit ESC. Repeat 126 more times (total of 128) or more. Now the Properties Palette still says the circle is selected, but ESC won't deselect it, and as soon as you do anything to change the selection (shift-click it, or click something else), you'll find the Properties Palette now says "No selection." Enter (gc) at the command prompt. The problem persists. I'd be very interested to know if you (or anyone) can repeat these steps and produce a different outcome. If you don't have Plant 3D, but have AutoCAD 2022 or earlier, see my post #47 to reproduce this bug using the Properties Palette.
