How to use API to control dual dimension and Inward rounding?

I have tried many time to record the macros of enable and disable the dual dimension and inward rounding.

I also insert the macros into my code. However,r it never really get control. Any suggestion?

SolidworksApi macros