Parametric dimensions from vertices???

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Korslight
Posts: 33
Joined: Thu Aug 11, 2016 3:26 pm

Parametric dimensions from vertices???

Post by Korslight »

Hi All,

I see in the documentation http://www.freecadweb.org/wiki/index.ph ... _Dimension that by selecting an edge with ALT you can create a parametric dimension. If however you do not have an edge to select, but two vertices is it currently possibly to create a parametric dimension.

Every time I create a dimension for a drawing and change the parametric model the dimensions do not become updated. I.E. the dimensions do not stay snapped with the original vertices and do not scale in magnitude.

Any advice?

--------------------

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6704 (Git)
Build type: Release
Branch: releases/FreeCAD-0-16
Hash: 0c449d7e8f9b2b1fb93e3f8d1865e2f59d7ed253
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Parametric dimensions from vertices???

Post by NormandC »

Hello,
Korslight wrote:If however you do not have an edge to select, but two vertices is it currently possibly to create a parametric dimension.
AFAIK It is not possible.
Korslight wrote:Any advice?
You could try the Drawing Dimensioning add-on. Rather than create Draft Dimensions in the 3D view, it allows you to add dimensions directly to the drawing views. When some changes are made to the part, you can recompute the dimensions.

http://www.freecadweb.org/wiki/index.ph ... mensioning
Korslight
Posts: 33
Joined: Thu Aug 11, 2016 3:26 pm

Re: Parametric dimensions from vertices???

Post by Korslight »

Hello NormandC,

Thank you for your response and suggestions.

I downloaded the "DrawingDimensioning" workbench and gave it a shot, but no dice unfortunately. When I updated the parametric model the drawing dimensions did not update.

I am a little confused because the documentation says:
No parametric updating, if the drawing is updated the dimensions need to be redone.
So doesn't that mean that it does not support parametric updating?

Is creating parametric drawings just something that is not yet available in FreeCAD? I am not a programmer, but it seems like the foundation to this has already been made in the "Sketcher" workbench as it is able to pull parametric information from the "Spreadsheet" workbench and from other dimensions created within sketches.

Would something like this be possible to incorporate into 0.17? That is unless it is already available and I do not know how to utilize it.

Thanks
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Parametric dimensions from vertices???

Post by triplus »

Korslight wrote:I downloaded the "DrawingDimensioning" workbench and gave it a shot, but no dice unfortunately. When I updated the parametric model the drawing dimensions did not update.
Yes in addition this part is important:
NormandC wrote:When some changes are made to the part, you can recompute the dimensions.
Therefore you have to manually press on the Drawing Dimensioning recompute tool button.
Korslight
Posts: 33
Joined: Thu Aug 11, 2016 3:26 pm

Re: Parametric dimensions from vertices???

Post by Korslight »

triplus,

Ah I see! That seemed to do the trick. I was thinking refresh (F5) like how to update the drawing normally. I had not discovered the "recompute dimensions" button.

Works perfect!

Cheers.
Korslight
Posts: 33
Joined: Thu Aug 11, 2016 3:26 pm

Re: Parametric dimensions from vertices???

Post by Korslight »

triplus,

Quick question. Would you know how to execute the recompute dimensions command from script or console? Unlike many other FreeCAD functions it does not post the command to the console.

Thanks again
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Parametric dimensions from vertices???

Post by triplus »

One example:

Code: Select all

import recomputeDimensions
recomputeDimensions.RecomputeDimensions().Activated()
Korslight
Posts: 33
Joined: Thu Aug 11, 2016 3:26 pm

Re: Parametric dimensions from vertices???

Post by Korslight »

triplus,

That is exactly what I am looking for, thank you.

One last thing for future reference; I understand the

Code: Select all

import recomputeDimensions

as that is the python module included in the DrawingDimensioning workbench, but how did you know to do the

Code: Select all

recomputeDimensions.RecomputeDimensions().Activated()

function?

Once again, thanks for being so helpful.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Parametric dimensions from vertices???

Post by triplus »

Korslight wrote:That is exactly what I am looking for, thank you.
You're welcome.
...but how did you know to do the

Code: Select all

recomputeDimensions.RecomputeDimensions().Activated()

function?
I looked in the source code on how it is done.
Korslight
Posts: 33
Joined: Thu Aug 11, 2016 3:26 pm

Re: Parametric dimensions from vertices???

Post by Korslight »

I am having a difficult time opening Drawing Dimensioning from the FreeCADCmd.exe console.

When I try to import recomputeDimensions it gives me an error along the lines of

Code: Select all

import recomputeDimensions
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "...\Mod\DrawingDimensioning\rs.py", line 1, in <module>
    from dimensioning import *
  File "...\Mod\DrawingDimensioning\d
line 740, in <module>
    FreeCADGui.addCommand('dd_help', helpCommand())
AttributeError: 'module' object has no attribute 'addCommand'
So I went into dimensioning.py and commented out the line:

Code: Select all

FreeCADGui.addCommand('dd_help', helpCommand())
I also commented the line out in recomputeDimensions.py:

Code: Select all

FreeCADGui.addCommand('dd_recomputeDimensions', RecomputeDimensions())
I was then able to successfully import recomputeDimensions, but when I tried opening my file via FreeCAD.open("...") it would crash the console immediately with a "Fatal Python error: This thread must be current when releasing". This only crashed when I had items that pertained to the Drawing Dimensioning workbench such as dimlines. It would not crash a file that had been unaffected by Drawing Dimensioning.

Any idea how to resolve these issues?
Post Reply