Skip to content

Instantly share code, notes, and snippets.

@mario52a
mario52a / Macro_Connect_And_Sweep.FCMacro
Last active July 21, 2024 21:40
This macro easily creates a connection between two objects, an object and a point or between two points (the center of the objects are the starting and ending points of the sweep) can be selected form a configurable ellipse polygon circle
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
***************************************************************************
* Copyright (c) 2016 2017 2018 2019 2020 2024 <mario52> *
* *
* This file is a supplement to the FreeCAD CAx development system. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License (LGPL) *
@mario52a
mario52a / Macro_FCConvertLines.FCMacro
Last active August 12, 2021 23:51
This macro convert the object line, wire in line Dash, DashDot, DashDotDot, Zigzag, Hand with the dimensions given.
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import division
"""
***************************************************************************
* Copyright (c) 2014 2015 2016 2017 2018 2019 2020 <mario52> *
* *
* This file is a supplement to the FreeCAD CAx development system. *
* *
* This program is free software; you can redistribute it and/or modify *
@mario52a
mario52a / Macro_FCCreaLoft.FCMacro
Created February 9, 2016 16:17
Specially written for easy lofting with lines generated by the macro Macro_FCTexture (but may be suitable and used for common lofts)
# -*- coding: utf-8 -*-
"""
***************************************************************************
* Copyright (c) 2016 <mario52> *
* *
* This file is a supplement to the FreeCAD CAx development system. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License (LGPL) *
* as published by the Free Software Foundation; either version 2 of *
@mario52a
mario52a / Macro Mouse Cross.FCMacro
Last active August 12, 2021 23:51
This small macro turns the arrow of the mouse in a precision cross. Small example of using the class ViewObserver() and the use of the keyboard with SoKeyboardEvent
# -*- coding: utf-8 -*-
# mouse cursor to Cross or Arrow + Grig
# ver 0.2 08/08/2014 PyQt4 and PySide
# ver 0.4 07/06/2019 compatible Python 3.
#
__title__ = "Macro_Mouse_Cross"
__author__ = "Mario52"
__wiki__ = "https://www.freecadweb.org/wiki/Macro_Mouse_Cross"
__url__ = "http://www.freecadweb.org/index-fr.html"
__version__ = "00.04"
@mario52a
mario52a / Macro_SelectVisible.FCMacro
Created January 2, 2016 18:41
This macro hidden all objects not selected if you selected one object hidden the hidden object are displayed and all objects not selected are hidden
import FreeCAD
# Macro_SelectVisible
__title__="Macro_SelectVisible"
__author__ = "Mario52"
__url__ = "http://www.freecadweb.org/index-fr.html"
__version__ = "00.02"
__date__ = "12/11/2015"
try:
compt = 0
@mario52a
mario52a / Macro_FCInfoToMouse.FCMacro
Last active September 20, 2022 08:23
Provide informations coordinates, length and angles in real time on the mouse in a bubble annotation displayed in the 3D screen
# -*- coding: utf-8 -*-
"""
***************************************************************************
* Copyright (c) 2016 <mario52> *
* *
* This file is a supplement to the FreeCAD CAx development system. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License (LGPL) *
* as published by the Free Software Foundation; either version 2 of *
@mario52a
mario52a / Macro ReproWire.FCMacro
Last active August 12, 2021 23:51
This macro create on duplicate to wire, face, object or subObject ... selected.
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import codecs #https://docs.python.org/2/howto/unicode.html
import Part,Draft
#24/10/2015, 22/09/2018, 03/07/2019, 14/03/2020
__title__ = "Macro_ReproWire"
__author__ = "Mario52"
__url__ = "http://www.freecadweb.org/index-fr.html"
@mario52a
mario52a / Macro_FCPropertyMemo.FCMacro
Last active August 12, 2021 23:51
This little macro create one Property additional (memo or other text) for you object (only Draft)
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
***************************************************************************
* Copyright (c) 2015, 2016, 2017, 2018, 2019, 2020 <mario52> *
* *
* This file is a supplement to the FreeCAD CAx development system. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License (LGPL) *
@mario52a
mario52a / Macro_FCInfoGlass.FCMacro
Last active December 18, 2021 19:23
Gives a series of informations about the selected shape and can display a directly in the 3D view
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
***************************************************************************
* Copyright (c) 2015 2016 <mario52> *
* *
* This file is a supplement to the FreeCAD CAx development system. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License (LGPL) *
@mario52a
mario52a / Macro FCTexture.FCMacro
Last active January 4, 2025 18:52
This small macro allows you to build a project 3D very easily from a bitmap image 256 levels of gray. I hope that this macro will revolutionize the way of thinking the CAD and CNC any image when what can be converted to object 3D without any intervention. Everything becomes possible regardless of the complexity of the image !
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
***************************************************************************
* Copyright (c) 2014 2015 2016 2017 2018 2019 2020 2021 2025 <mario52> *
* *
* This file is a supplement to the FreeCAD CAx development system. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License (GPL) *