I am struggling with an ETO form and need some assistance.
Can anyone please show me the code that when I select the radio button for Fit Plane the input box for Thickness becomes de activated so no input is possible.
I am only self taught in programming so please keep it as simple as possible ideally if you can actually write the code and show me I might understand where I have been going wrong I have been trying for a while now and have just confused myself.
Afraid it doesn’t help as I am not working with the drop down list but a totally separate text box which I want to disable based upon the radio button choice.
If this does work then I dont know how to apply it.
I don’t think the drop-down list was discussed in the post but how to deactivate RadioButton which if I’m not mistaken would be what you want to achieve, and the important part is this code of this file:
and also the last posts of the discussion that I linked before
Your help in December was the catalyst for me to try some other ETO forms but I have now created another problem for myself can I please ask you to take look at my script and explain where I have gone wrong. The dialogue opens up and I don’t want either box to be ticked but once I select one of the two tick boxes then I want the other to be disabled, easy right, well that’s what I thought but still cannot get it to work.
I re named the file to txt due to outlook you will need to rename it py.
If you don’t have time then please don’t put yourself out.
Some hints how this works: I’ve just added a Tag to each checkbox so i can identify from which checkbox your event OnCCheckedChanged is fired once they are enabled or disabled:
def OnCCheckedChanged(self, sender, e):
if not isinstance(sender, forms.CheckBox): return
if sender.Tag == "Import":
self.m_export_checkbox.Checked = False
self.m_export_checkbox.Enabled = False
self.m_export_checkbox.Enabled = True
elif sender.Tag == "Export":
self.m_import_checkbox.Checked = False
self.m_import_checkbox.Enabled = False
self.m_import_checkbox.Enabled = True
The above function has some notes in the attached file. Note that by default, if you add a checkbox it is not checked by default. The reason why your checkboxes where both checked on start has been that you called the event using these two lines:
Many thanks for the reply and explanation, I appreciate you taking the time to help. I must admit I do struggle to find good information for reference when it comes to ETO and my knowledge is very limited just being self taught with no real structure to follow, I give it a go and hope for the best. Then when I can get no further I have man up and admit defeat and hope someone will give me some guidance.
I appreciate the rest of the script is messy I was bringing sections from other scripts and haven’t got round to tidying things up yet, but I will.
Once again many thanks and I hope from here on I should cope.
I have been revising my script that you kindly looked at for me and wondered if you can give me another pointer. I have removed the duplicate calls as discussed and have moved the check to see if the file is the main module to the end of the file as I think that is where it should and generally goes not in the middle of the script as I had it. This is where I now have a problem the script calls the dialogue box but does not allow me to select any points after I have selected my options.
I have tried every permutation I can think of with no joy so unsure what the problem is could you please give me a nudge in the right direction.
the problem is that after you click OK in the dialog you have this in your function named ShowImportExportPointsDialog():
return dialog.GetImport(), dialog.GetExport(), dialog.GetFormatOption()
the first return will get you back to where you have called the function, which is this code:
if __name__ == "__main__":
the reason why nothing happens is simply because you have all the code to import / export points in the function you’ve just left. I’ve made some changes to your script and added some comments. Also note the comments which i wrote under these lines:
Many thanks once again , I’m a slow learner but I’m sure I will get there. I have had problems when e-mailing py files and was unsure if there was any issue with uploading the same file extension, if you are advising me that py extensions are ok I will try in the future.
Off now to read and try to understand your corrections to my script.
I’m still looking for good beginners information for ETO forms, if you can recommend anything be it web based or book then please let me know, I have looked at most examples I can find but they don’t give a reason why something has or not been done a bit monkey see monkey do that will only get me so far.