Auto dim in 3D and Viewer

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
jack-not-really
Posts: 14
Joined: Fri Nov 15, 2013 5:30 pm

Auto dim in 3D and Viewer

Post by jack-not-really »

Some time ago, i have seen a page that describes the python use of automatic dimensioning with update on recompute.
Sorry, i have forgotten the page.
Can anybody help?

Kind regards,
Jack - not really
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Auto dim in 3D and Viewer

Post by jmaustpc »

Are you meaning a Draft wb dimension in linked mode? E.g click Draft Dimension icon, press and hold the Alt key, then select an edge. Draft dimension will appear and be linked to that edge and auto update if the edge is changed.

You can use Draft Dimension from a script or the GUI.

this is a link to the page on the wiki
http://www.freecadweb.org/wiki/index.ph ... _Dimension

Jim
jack-not-really
Posts: 14
Joined: Fri Nov 15, 2013 5:30 pm

Re: Auto dim in 3D and Viewer

Post by jack-not-really »

sorry, I didn't mean that.
It was an example where dimension was created in 3D and auto updated in all 2D projection in the svg view.
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Auto dim in 3D and Viewer

Post by jmaustpc »

In the Python window you can get mouse tips from the pop-up help

for example the code below makes a dimension on a default Part Box I had in my model

Code: Select all

 import Draft
>>> Draft.makeDimension(FreeCAD.ActiveDocument.Box,2,0,FreeCAD.Vector(-2.32557463646,5.0,0.0))
when you type the dot after Draft on the second line, the function browser will pop up, hold the mouse above the item you want and a mouse tip will pop up.

If you put one of these dimensions in a Drawing in Drawing workbench or from Draft WB, you get a dimension in your Drawing that will auto update along with the dimension in your model which in its self will auto up date when the relevant Part Box parameter is changed.
Draftymakedimension.png
Draftymakedimension.png (200.1 KiB) Viewed 2353 times
The Python code to put an item in the Drawing is explained in the wiki just search "Drawing" and look at the Drawing module page. I this is the URL to the wiki page.
http://www.freecadweb.org/wiki/index.ph ... ing_Module

I don't know what version of FreeCAD you are working with , but there has been quite a few updates in these areas you are talking about since 0.13 and the Drawing module is currently being actively developed. So expect changes and complications etc.

Jim
Post Reply