MACRO:Work Feature 2014_12

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
rentlau_64
Posts: 181
Joined: Tue Oct 21, 2014 9:47 am
Location: Pau (France)

Re: MACRO:Work Feature 2014_12

Post by rentlau_64 »

Mario52,

Woaw The MACRO Recipe wiki is very nice.
Thank you very much for your help.
I will continue to work on these tools and keep all of you inform.

See you soon.
Rentlau_64
mario52
Veteran
Posts: 4701
Joined: Wed May 16, 2012 2:13 pm

Re: MACRO:Work Feature 2014_12

Post by mario52 »

hi
a christmas gift
we must also put some examples
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
mario52
Veteran
Posts: 4701
Joined: Wed May 16, 2012 2:13 pm

Re: MACRO:Work Feature 2014_12

Post by mario52 »

hi
with the new installation I have good return of icons i ave replace alls image

before and after
ImageImage

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
rentlau_64
Posts: 181
Joined: Tue Oct 21, 2014 9:47 am
Location: Pau (France)

Re: MACRO:Work Feature 2014_12

Post by rentlau_64 »

Mario52,

Find the new release of Work feature with fix for sketch and bbox.
WF_2014_12_27.zip
(149.74 KiB) Downloaded 357 times
Wmayer,

I guess I fix some of the issues you described. Feel free to give me your comments.

Thank you very much to all of you.

Rentlau_64
mario52
Veteran
Posts: 4701
Joined: Wed May 16, 2012 2:13 pm

Re: MACRO:Work Feature 2014_12

Post by mario52 »

hi
done Macro_WorkFeatures

EDIT : 14:29
a suggetion section plane
1: it would be interesting to have a function like Macro_Align_View_to_Face
2: adjusting the camera to a position (example with spinBox : x=45°y=25° z=15°) and create plane (very interesting)
ex : (no finished)
FCCamera_01.png
FCCamera_01.png (34.79 KiB) Viewed 3373 times
mario
Last edited by mario52 on Sat Dec 27, 2014 1:43 pm, edited 1 time in total.
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
wmayer
Founder
Posts: 20324
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: MACRO:Work Feature 2014_12

Post by wmayer »

Great!

Object(s) center:
Works correctly with a sketched built of one element. When the sketch has e.g. a rectangle and a circle and i Select the circle I get this:

Code: Select all

m_wire = [<Part::Part2DObject>, <Part::Part2DObject>]

m_wire = [<Part::Part2DObject>, <Part::Part2DObject>]Traceback (most recent call last):
  File "C:/Projects/FreeCAD-git/macros/WF_2014_12_26.FCMacro", line 867, in plot_centerObjectPoint
    Vector_Objects_Center = centerObjectsPoint(m_objs,info=0)
  File "C:/Projects/FreeCAD-git/macros/WF_2014_12_26.FCMacro", line 436, in centerObjectsPoint
    xmax, xmin, ymax, ymin, zmax, zmin = minMaxObjectsLimits(objs,info=info) 
  File "C:/Projects/FreeCAD-git/macros/WF_2014_12_26.FCMacro", line 383, in minMaxObjectsLimits
    box = m_wire.Shape.BoundBox
AttributeError: 'list' object has no attribute 'Shape'
* The command Plane=(Point, _|Axis) insists to have a line and point not lying on this line. Why? The selected axis becomes the normal of the plane and to get a unique plane only one point is needed independent where it is
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: MACRO:Work Feature 2014_12

Post by NormandC »

Guys,

The Macro WorkFeatures wiki page is great, but what is less great is linking a ZIP archive. Some people have issues with having to download something without being able to look at the code first.

Please consider sharing your work using a source code hosting service like GitHub. What's great with it is that other people can easily fork your work, make enhancements and then request their changes to be merged, which can be done through the web interface.

Git requires some getting used to but it's worth it.

For a single large script that exceeds the limit of the wiki, you can use https://gist.github.com/ and simply paste the code.
rentlau_64
Posts: 181
Joined: Tue Oct 21, 2014 9:47 am
Location: Pau (France)

Re: MACRO:Work Feature 2014_12

Post by rentlau_64 »

Mario52, Wmayer,

Find the MACRO with the 2 issues pointed by Wmayer corrected.
WorkFeatures_2014_12_28.zip
(149.99 KiB) Downloaded 476 times
Normand,
I am learning GIT HUB and will put soon the MACRO on it.

Rentlau_64
mario52
Veteran
Posts: 4701
Joined: Wed May 16, 2012 2:13 pm

Re: MACRO:Work Feature 2014_12

Post by mario52 »

hi
i modify the link
normandc wrote:For a single large script that exceeds the limit of the wiki, you can use https://gist.github.com/ and simply paste the code.
I will adopt this system for my big macro
thanks
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
rentlau_64
Posts: 181
Joined: Tue Oct 21, 2014 9:47 am
Location: Pau (France)

Re: MACRO:Work Feature 2014_12

Post by rentlau_64 »

Mario52,

I completed one release of Work Feature Macro with:
1 One "Align To" button to allow the user align the view either
- perpendicular to a selected Face,
- aligned to a selected Edge,
- aligned along 2 points.
2 and with a "Create Plane" button to create a plan
perpendicular to the view and either
- attached to a point defined by a mouse click or
- attached to an alredy existing point

I think I also corrected the bug you gave me concerned the bounding box.

If you feel it is ok could you upfate the Macro recipes for me?
Thank you so much for your help.
Merci d'avance pour ton aide.

Rentlau_64
Attachments
WF_2015_01_18.tar.gz
(158.84 KiB) Downloaded 328 times
AlignTo.png
AlignTo.png (29.5 KiB) Viewed 3239 times
Post Reply