This is a known limitation, see SPR 369252: “IDimension::DrivenState cannot be set for dimension in 3D sketch”. Please email apisupport@solidworks.com and let them know that you would like to be notified when this fix is implemented. Given how long this SPR has existed, it appears that this isn’t a high priority issue for them.
I am not aware of a reasonable workaround, unfortunately. I tested ISldWorks::RunCommand with swCommands_Dimension_Driven_Toggle but this did not appear to work on any sketch dimension let alone a 3D sketch dimension.
Ready to start learning the SolidWorks API? Sign up for FREE membership here.Keep up with new videos, macros, and training events by joining our mailing list:
Are there any modifications that can be made to this code (or an alternate method) that it works on 3D sketch dimensions?
This is a known limitation, see SPR 369252: “IDimension::DrivenState cannot be set for dimension in 3D sketch”. Please email apisupport@solidworks.com and let them know that you would like to be notified when this fix is implemented. Given how long this SPR has existed, it appears that this isn’t a high priority issue for them.
I am not aware of a reasonable workaround, unfortunately. I tested ISldWorks::RunCommand with swCommands_Dimension_Driven_Toggle but this did not appear to work on any sketch dimension let alone a 3D sketch dimension.