Wiki

Clone wiki

FlatCAM / devdoc

Development Documentation

This section contains guides and reference documentation for developing FlatCAM.

TCL Shell Commands

Soon...

Adding an option to an Object

This describes the steps to adding an option to a FlatCAMObject (Geometry, Gerber, Excellon or CNCJob).

Let's assume the name of the option is optname and we want to add it to FlatCAMGeometry.

  1. Create the GUI input (optional): In ObjectUI.py edit GeometryObjectUI.__init__() and add the corresponding label and form field. Use the form field types in GUIElements.py.
  2. Add the same to GeometryOptionsGroupUI.__init__() in FlatCAMGUI.py.
  3. Add the option to the object: Edit FlatCAMGeometry.__init__() and add optname to self.options with a default value.
  4. Reference the GUI field for the given option in FlatCAMGeometry.form_fields in FlatCAMGeometry.set_ui().
  5. Add the option the the application defaults in FlatCAMApp.__init__. Edit FlatCAMApp.defaults and add geometry_optname.
  6. Reference the form field for defaults and options. Edit FlatCAMAapp.default_form_fields by adding the same entry with value: self.defaults_form.geometry_group.<<<your field here>>>.
  7. Do the same for `FlatCAMApp.options_form_fields with value: self.options_form.geometry_group.<<<your field here>>>.

Updated