Skip to content

Instantly share code, notes, and snippets.

@mario52a
mario52a / Macro_Connect_And_Sweep.FCMacro
Last active August 12, 2021 23:51
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 <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 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 FCCamera.FCMacro
Last active August 12, 2021 23:51
This macro can rotate the screen in a defined angle and the defined axis and creates a plan to face the screen to create a form in the specified plan positions the selected face facing the screen, to detect the position of the camera, align view to face or to axis, align the object to view.
# -*- coding: utf-8 -*-
"""
***************************************************************************
* 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) *
* as published by the Free Software Foundation; either version 2 of *
@mario52a
mario52a / Macro_WireXYZ.FCMacro
Last active August 12, 2021 23:51
This macro creates a wire (or points) with the coordinates extracted from a file. The coordinates X Y Z are separated by a space.
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
# created a wire with coordinate x y z separated (in the file without coma)
__title__= "Macro_WireXYZ"
__author__= "Mario52"
__date__= "2020/10/16"
__version__= "00.03"
##
#EX:
#0 0 0
@mario52a
mario52a / FCInfo_fr_Ver_1-12_No_Docked_Ubuntu.FCMacro
Created February 25, 2015 16:49
Gives a series of informations about the selected shape and can display a conversion of length, inclination (degrees, radians, grades, pourcent) shape, surface, volume and the weight of the form in the density selected in different units of quantities international and Anglo-Saxon. (Version Française)
# -*- coding: utf-8 -*-
"""
***************************************************************************
* Copyright (c) 2014 <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 *