How to use PCB_PLOT_PARAMS SetDrillMarksType in V6.99?

In V6 I simply passed an integer of 0, 1 or 2 as an argument for PCB_PLOT_PARAMS.SetDrillMarksType( DrillMarksType aVal ), but that’s not possible in V6.99. I get the exception:

TypeError: in method ‘PCB_PLOT_PARAMS_SetDrillMarksType’, argument 2 of type ‘DRILL_MARKS’

I cannot figure out what to set as an argument instead. Feels like I’ve tried everything.

plot_options.SetDrillMarksType(pcbnew.PCB_PLOT_PARAMS.FULL_DRILL_SHAPE) gives me the error:

AttributeError: type object ‘PCB_PLOT_PARAMS’ has no attribute ‘FULL_DRILL_SHAPE’

Same with:
plot_options.SetDrillMarksType(pcbnew.PCB_PLOT_PARAMS.DRILL_MARKS.FULL_DRILL_SHAPE)
And with:
plot_options.SetDrillMarksType(pcbnew.DRILL_MARKS.FULL_DRILL_SHAPE)

I’ve tried looking in the source code to figure out how to use the DRILL_MARKS enum, but I’m really not a software developer and I cannot figure out which class it belongs to.

It doesn’t belong to any class, it just isn’t exported in swig so the answer to the topic is “you can’t”.

Not until this lands :wink:

Awesome! Thanks a lot! That certainly explains my problems :smile:

@albin I just (8:02 CET) looked into the commits: it’s done.

GitHubDesktop_jZrIZ7KpNN

Yea, this was even quicker (pun intended) than usual. :smile: I didn’t even have to report a bug. I will test it layer today, as soon as it’s included in a nightly build for windows. I don’t have the environment set up for compiling KiCad atm.

Presumably tomorrow’s nightly.

I’ve installed todays nightly build which should contain this fix. It’s built from commit aa537fe5, one commit after this fix (25688eb7).

But I’m still unable to use this enum. Probably because I don’t have a clue what I’m doing when I don’t have the Doxygen docs to look up things. :wink:

I’ve tried these without any luck:
pcbnew.DRILL_MARKS.FULL_DRILL_SHAPE
pcbnew.PCB_PLOT_PARAMS.FULL_DRILL_SHAPE
pcbnew.PCB_PLOT_PARAMS.DRILL_MARKS.FULL_DRILL_SHAPE

What’s the correct way to use this enum?

But it’s there:

devenv_bZy3U79xtj

Yes, but how do I use it in Python?

pcbnew.DRILL_MARKS.FULL_DRILL_SHAPE gives me:

AttributeError: type object ‘PCBNEW’ has no attribute ‘DRILL_MARKS’

Or something very similar.

It will show up as <enum_name>_<value> e.g. pcbnew.DRILL_MARKS_FULL_DRILL_SHAPE

If it’s not there that means the nightly doesn’t have the fix yet.

1 Like

Thank you! That I haven’t tried. I’ll test tomorrow.

That certainly did the trick! Thanks again!