Skip to content

Instantly share code, notes, and snippets.

@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 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_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_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 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_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_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_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_Duplicate_Selection.FCMacro
Created June 7, 2016 15:14
Start the macro select the object IN THE 3D VIEW the "ForbiddenCursor" stay if the or one selection is duplicate the macro stay resident
# -*- coding: utf-8 -*-
import FreeCADGui
import PySide
from PySide import QtGui ,QtCore
from PySide.QtGui import *
from PySide.QtCore import *
__title__ = "Macro_Duplicate_Selection"
__author__ = "Mario52"
__url__ = "http://www.freecadweb.org/index-fr.html"
@mario52a
mario52a / Macro_Make_Arc_3_points.FCMacro
Last active August 12, 2021 23:50
Creates a arc from 3 selected points
# -*- coding: utf-8 -*-
from FreeCAD import Base
__title__ = "Macro_Make_Arc_3_points"
__author__ = "Mario52"
__url__ = "http://www.freecadweb.org/index-fr.html"
__version__ = "00.01"
__date__ = "14/07/2016"
global selected; selected = []