curved slot macro, fully constrained & parametric

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
galou_breizh
Posts: 436
Joined: Wed Sep 15, 2010 9:38 am

Re: curved slot macro, fully constrained & parametric

Post by galou_breizh »

spanner888 wrote: Mon Feb 24, 2020 6:32 am Create curved slot/s with either curved or flat ends, fully constrained AND using aliased variables auto created in spreadsheet.
Nice macros. I invite you to submit them to the official repository https://github.com/FreeCAD/FreeCAD-macros (or I can do it if you wish).

There's a serious issue with your macro but the issue could be in FreeCAD's core. If you create a new document after running your macro, FreeCAD crashes.

Can someone confirm the bug?

OS: Ubuntu 18.04.4 LTS (i3/i3)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Python version: 3.6.9
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: C/Default (C)
galou_breizh
Posts: 436
Joined: Wed Sep 15, 2010 9:38 am

Re: curved slot macro, fully constrained & parametric

Post by galou_breizh »

I also have a remark. Can you explain the 'Q,R,S' in the definition of cols?

Do you also know that you could use string.ascii_uppercase to define cols and that you can iterate over a string?
spanner888
Posts: 326
Joined: Tue May 28, 2019 10:51 am

Re: curved slot macro, fully constrained & parametric

Post by spanner888 »

galou_breizh wrote: Mon Mar 16, 2020 4:35 pm I also have a remark. Can you explain the 'Q,R,S' in the definition of cols?

Do you also know that you could use string.ascii_uppercase to define cols and that you can iterate over a string?
The 'Q,R,S', should have been 'Q', 'R', 'S'. I have fixed and will commit changes.

Also yes, you are correct about the better way to iterate over a string, my python skills have increased a bit since then and I can see that would be better way.

However I suspect there are better ways to work with spreadsheet cells, that I have not found yet, so I am just adding the 'Q', 'R', 'S' fix for now.

thanks for your help.
spanner888
Posts: 326
Joined: Tue May 28, 2019 10:51 am

Re: curved slot macro, fully constrained & parametric

Post by spanner888 »

galou_breizh wrote: Mon Mar 16, 2020 4:28 pm Nice macros. I invite you to submit them to the official repository https://github.com/FreeCAD/FreeCAD-macros (or I can do it if you wish).
Hmmm - just thinking about where to add the two macros. The curvedSlots one is fully parametric and could go in the ParametricObjectCreation directory, but the 2nd macro curvedSlotsWithTabs, is not fully parametric.

Alternate could be not to add to the macros repo and just to list them on the web page in the "Other interesting macros created by FreeCAD users" section at Macro recipes

I am open to suggestions/guidance.
galou_breizh
Posts: 436
Joined: Wed Sep 15, 2010 9:38 am

Re: curved slot macro, fully constrained & parametric

Post by galou_breizh »

You could put one macro in the ParametricObjectCreation folder and the other one in ObjectCreation.
Post Reply