Thank you, guy.edi wrote: ↑Tue Feb 11, 2020 5:25 pmHello paddle,
I wrote a macro doing something similar to what you want.
The macro draws centered figures in sketcher: rectangle, square, rectangle with rounded corners, square with rounded corners, circle and hexagon.
Each figure can be drawn with or without constraints. If you coose "Add constraints" you can change the values of the constraints after drawing. The figures keep always centered.
How to use the macro:
1. Open a new sketch in SKETCHER or PART DESIGN
2. Start the macro
3. Select what you want to be drawn
4. Draw the figure by pressing "draw figure"
5. End the macro by pressing "close window"
Could you give it a look, please.Traceback (most recent call last):
File "MacroUser/CenteredFiguresInSketcher.FCMacro", line 251, in <module>
rechteckSkizze() # Programm ausführen
File "MacroUser/CenteredFiguresInSketcher.FCMacro", line 18, in __init__
self.dialogFenster() # meine HauptFunktion
File "MacroUser/CenteredFiguresInSketcher.FCMacro", line 87, in dialogFenster
self.wait() # erzeugt eine Fehlermeldung, aber ohne diese Zeile bleibt das Fenster nicht offen
<class 'AttributeError'>: 'rechteckSkizze' object has no attribute 'wait'
Hi, this post made remember your macro so I tried it out today and I found it didn't work well when using stylesheets: So I added this line to it:
Code: Select all
If at all you probably mean Sketch_Proifle.FCMacro or Sketcher_Profile.FCMacro. But for my taste that is far too global. Profiles are as far as I know used in lofts and sweeps, and can have arbitrary shapes. But using the prefix "Sketcher seems a good idea.