Select Dimension with Property Manager Page

I'm building a macro for linking dims to a custom property (in a PART).

I have a problem. When bringing a Property Manager Page up for this, Instant 3D-button (from SW) greys out and I'm not able to select dims from a model.

This code is still far from final but can you guide me? What is wrong? Why it is not possible to "activate" model with Instant 3D and select dims?

There are another selection boxes for a plane and a body and these works just fine. I have copied most of this code from a macro:

' Mirror part by Boinon Stéphane
' Nov 26, 2007 5:33 PM  in response to: Roland Schwarz
' https://forum.solidworks.com/message/41028#41028

SolidworksApi macros