Author Topic: How to loop over all styles in script  (Read 270 times)

Offline billo

  • Ewok
  • *
  • Posts: 23
    • View Profile
How to loop over all styles in script
« on: January 10, 2023, 19:44:35 pm »
I'm trying to loop over all available styles (using a python script). Documentation for CamBamUI says I am able to do that using CAMStyles.

CamBamUI.CAMStyles returns a CAMStyleManager, but I do not see how to get from the CAMStyleManager object to an iterable list of styles.

Any advice?

Tia
Bill

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7146
    • View Profile
    • Cambam V1.0 French Doc
Re: How to loop over all styles in script
« Reply #1 on: January 10, 2023, 20:09:15 pm »
Hello

I don't know the solution but maybe you can explore the BreakEdge plugin with something like ILSpy (I do not see the sources on the topic) ; this plugin use a list of style libraries and a list of styles.



https://cambamcnc.com/forum/index.php?topic=6743.0

++
David
« Last Edit: January 10, 2023, 20:11:50 pm by dh42 »

Offline billo

  • Ewok
  • *
  • Posts: 23
    • View Profile
Re: How to loop over all styles in script
« Reply #2 on: January 28, 2023, 17:22:30 pm »
I've spent a few hours following various tips and clues with no luck.

I've resorted to hardcoding style names into my script. Slightly unsettling, but works fine.