Macro CirclePlus: Difference between revisions

From FreeCAD Documentation
m ((With GUI))
m ((With GUI))
Line 4: Line 4:
{{Macro
{{Macro
|Name=Macro CirclePlus
|Name=Macro CirclePlus
|Description=Creates circle or arc giving radius, diameter, circumference, area, startangle, endangle, arc, anglecenter, cord, arrow, center (point), placemObject on choice.
|Description=Creates circle or arc giving radius, diameter, circumference, area, startangle, endangle, arc, anglecenter, cord, arrow, center (point), placemObject on choice (With GUI).
|Author=mario52
|Author=mario52
|Version=0.1
|Version=0.1

Revision as of 10:56, 13 December 2018

Other languages:

Macro CirclePlus

Description
Creates circle or arc giving radius, diameter, circumference, area, startangle, endangle, arc, anglecenter, cord, arrow, center (point), placemObject on choice (With GUI).

Macro version: 0.1
Last modified: 2018/07/14
Author: mario52
Author
mario52
Download
None
Links
Macro Version
0.1
Date last modified
2018/07/14
FreeCAD Version(s)
None
Default shortcut
None
See also
None

Description

This small macro create a circle or arc giving radius, diameter, circumference, area, startangle, endangle, arc, anglecenter, cord, arrow, center (point), placemObject on choice (With GUI).

The circle is still facing the screen (with getCameraOrientation) (or give the placement)

The click mouse on spinbox recolour the frame for indicate the associate spinbox in green and in orange the optional spinbox

If one value is omitted or inadequate the Ok is coloured in red

Temporary code for external macro link. Do not use this code. This code is used exclusively by Addon Manager. Link for optional manual installation: Macro


# This code is copied instead of the original macro code
# to guide the user to the online download page.
# Use it if the code of the macro is larger than 64 KB and cannot be included in the wiki
# or if the RAW code URL is somewhere else in the wiki.

from PySide import QtGui, QtCore

diag = QtGui.QMessageBox(QtGui.QMessageBox.Information,
    "Information",
    "This macro must be downloaded from this link\n"
    "\n"
    "https://gist.githubusercontent.com/mario52a/0ed8129bacbe9124a41e3ae1d378d5b7/raw/e01ef57a72dce551474e7320e38798f0da655148/Macro%2520CirclePlus.FCMacro" + "\n"
    "\n"
    "Quit this window to access the download page")

diag.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
diag.setWindowModality(QtCore.Qt.ApplicationModal)
diag.exec_()

import webbrowser 
webbrowser.open("https://gist.githubusercontent.com/mario52a/0ed8129bacbe9124a41e3ae1d378d5b7/raw/e01ef57a72dce551474e7320e38798f0da655148/Macro%2520CirclePlus.FCMacro")


Use

Copy the code and paste it in the macro directory

  • X Y Z : coordinates of circle if not coordinates the circle is created on point 0,0,0
  • radius : radius of cicle
  • diameter : diameter of circle
  • Reset : reset the coordinate value
  • Equal : copy the X value in Y and Z window
  • CheckBox :
  • Options : other options for create circle
  • Point : if checked the central point is created
  • Info : if checked display the information give in the macro
  • Face : if checked the face is created on circle
  • Sector : if checked the sector is created
  • Segment : if checked the segment is created
  • SpinBox 8 : give the height of text in the macro
  • Quit : quit the macro (this button is coloured in red in case error)
  • Ok : create the circle
  • Options available
  • circumference : circumference of circle
  • area : area of circle
  • startangle : start angle for arc
  • endangle : end angle for arc
  • arc and anglecenter : arc in combination with anglecenter
    • arc = length of arc
    • anglecenter = angle of center circle to extremities of arc
  • cord and arrow : cord in combination with arrow of circle
    • cord : length of cord of circle
    • arrow : length of arrow of circle

Script

Download image positioning on the icon and then drag the mouse right click "save as" (do not change the name)


Memo of circle

Examples codes

examples 1, 2, 3
examples 1, 2, 3
examples
examples

Version

ver 0.1 , 2018-07-14 : add create segment

ver 0.0 , 2018-07-10 :