I am no expert in that matter but i think this is a limitation related to TD internal logic and the way it generates things. There may be a way to achieve it this way but only using a script CHOP (see Vals member in the channel class).
In any other cases you will need to use the parameter way op(‘Constant1’)[‘myChan1’].par.const0value = 0
FYI, the reason for this is that the first method is working with a “CHOP Channel” which generally can NOT be “set” with python - only “got”. Whereas the second method is not actually working with a “CHOP Channel” but instead a “Parameter” - and all parameters are generally “settable” and “gettable”.
The key thing to note is that the Constant CHOP is special in that for every “constant” that you create in the Constant CHOP, it will (behind the scenes) create a new CHOP channel that will use the evaluated value of the value parameter for that constant.
Unfortunately you can’t easily reference then by their name parameters in this way for numerous reasons - like the name you enter could be changed if it is a duplicate. Also the name parameter supports pattern expansion to create many channels from one constant.
If you want to create “constant” channels that you can reference via names instead of having to remember which const#value goes with which name, I beleive the recommended method is to use Custom Parameters, and you could actually just make a Base COMP that has all your named custom parameters (accessible by op('BaseCOMP_Constant').par.Mycustomname = 0 for example) and inside, a Parameter CHOP that will by default create CHOP Channels for every custom parameter of the enclosing COMP.
If you internally connect that Parameter CHOP to an Out CHOP, and then you will have your own highly customizable “Constant CHOP” including the ability to set default values and custom ranges for the sliders instead of the default zero to one range in a Constant CHOP.