parametric dimensions of sketch in TechDraw

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
sankey
Posts: 10
Joined: Sun Mar 12, 2017 1:56 am

parametric dimensions of sketch in TechDraw

Post by sankey »

Hello!

I want to start with a 2D sketch and end with a drawing containing the sketch and parametric dimensions on the sketch. First I tried the Drawing module, then the Drawing Dimension module, but quickly realized that none of my dimensions were parametric. Then I upgraded to FreeCAD 0.17 and tried the TechDraw module, but I could not draw any dimensions at all on my sketch after adding it as a "Draft WB" object:
insert_sketch.png
insert_sketch.png (32.54 KiB) Viewed 3560 times
So, I slightly extruded the sketch and added a view of the extruded part object, and finally I could make parametric dimensions:
insert_part.png
insert_part.png (31.73 KiB) Viewed 3560 times
However, this is roundabout, and probably very wrong. I was wondering if there was a better solution?

For reference, here is a wireframe of my sketch:
sketch_export.png
sketch_export.png (33.69 KiB) Viewed 3560 times
OS: Debian GNU/Linux 8.7 (jessie)
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.17.10473 (Git)
Build type: Unknown
Branch: master
Hash: 78b986a2657b7de79b6e350a2535dc0fbfe3f1cf
Python version: 2.7.9
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.7.0
User avatar
wandererfan
Veteran
Posts: 6317
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: parametric dimensions of sketch in TechDraw

Post by wandererfan »

A Sketch has a Shape property, so why not just add a regular DrawView of the Sketch and dimension that?
sankey
Posts: 10
Joined: Sun Mar 12, 2017 1:56 am

Re: parametric dimensions of sketch in TechDraw

Post by sankey »

wandererfan wrote:A Sketch has a Shape property, so why not just add a regular DrawView of the Sketch and dimension that?
I'm not completely sure what you mean by "DrawView of the Sketch". Do you mean select the sketch and click the button "Insert a new View of a Part in the active drawing"? When I do that, I see this error in the console:

Code: Select all

App::Document::_RecomputeFeature(): Unknown exception in Feature "View" thrown
and this is what the resulting view looks like:
view_error_adding_sketch.png
view_error_adding_sketch.png (109.77 KiB) Viewed 3527 times
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: parametric dimensions of sketch in TechDraw

Post by NormandC »

Hello sankey,

We chatted on IRC/Gitter, welcome to the forum.

I believe wandererfan (who's the current TechDraw workbench developer BTW) meant DraftView. Its purpose is to project 2D elements from the Draft workbench unto a page. I wasn't aware it worked on sketches too, but it does! Cool.

By default it creates the projection at 1:1 scale, you need to edit the scale afterwards.
Attachments
FC017_Sketch_to_DraftView_01.png
FC017_Sketch_to_DraftView_01.png (137.78 KiB) Viewed 3525 times
sankey
Posts: 10
Joined: Sun Mar 12, 2017 1:56 am

Re: parametric dimensions of sketch in TechDraw

Post by sankey »

Oh, I see. I also tried that, but I cannot add dimensions to a DraftView. Looking at your screenshot, I can even see the dimensions buttons are greyed out!
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: parametric dimensions of sketch in TechDraw

Post by NormandC »

You're right, a DraftView cannot be dimensioned, as none of its geometry is selectable.

But! That was my mistake, I mistook which view tool wandererfan was talking about. It's actually the one labelled Insert Projection Group in the TechDraw menu. Image TechDraw_NewProjGroup

With a Projection Group (it can contain a single view), the dimension tools are active. Select an edge or two vertices then click on the dimension type.
Attachments
FC017_Sketch_ProjGroup_01.png
FC017_Sketch_ProjGroup_01.png (79.83 KiB) Viewed 3521 times
sankey
Posts: 10
Joined: Sun Mar 12, 2017 1:56 am

Re: parametric dimensions of sketch in TechDraw

Post by sankey »

Hm, I can't get it to work, but it's good to see that it works for you (therefore the feature does exist). I simply get an error when I try to insert a projection group like you said:

Code: Select all

App::Document::_RecomputeFeature(): Unknown exception in Feature "ProjItem" thrown
So I tried mimicking your project by creating a Body, creating a new Sketch, then adding that sketch to the TechDraw drawing, but same error.

I'm just going to upload the fcstd file, it contains one sketch and one TechDraw drawing (empty). Maybe you can try?
Attachments
cargo_bike.fcstd
(26.97 KiB) Downloaded 47 times
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: parametric dimensions of sketch in TechDraw

Post by NormandC »

I had no problem creating the Projection Group (see attached file), so there must be something wrong with your set up. What happens when you open my file?

How did you install FreeCAD 0.17? Did you compile it yourself (since you're on Debian I'm guessing so)? One thing I just noticed from your FreeCAD info is that your OCC (6.7.0) version is extremely outdated. It's provided by the liboce-0.15 series of packages. If you ever need to go 3D with your model, you'll find that it's best to get a very recent OCC version. IMO 6.7.0 from December 2013 doesn't cut it anymore.

The OCE project on which the Debian/Ubuntu packages are based has fallen far behind of upstream OCCT, and new stuff on the FEM workbench requires OCC 7+. Thus on Windows and OS X they already switched back to the original OCCT last year. I was the sole packager for the FreeCAD's project Ubuntu PPA for 4 years before leaving the "position" (LOL) but I still help out from time to time. So just last week with much help from a few fellow forum members here I finally succeeded in packaging OCCT 7.1.0 and we've rolled it out on the Daily Builds PPA. I doubt that the packages are compatible with Debian though, unless one of the currently maintained Ubuntu versions are perfectly aligned in their libraries with Jessie. EDIT: I checked, no such luck.
https://launchpad.net/~freecad-maintain ... ecad-daily

One thing that could be done from our end (the guys who package FreeCAD for one OS or the other) though is to update the AppImage available at https://github.com/FreeCAD/FreeCAD/rele ... g/0.17_pre
Even though it's a little old, why don't you give it a shot and see if creating TechDraw views work in it? scratch that, I just realized your system is 32-Bit, unfortunately the AppImage is 64-Bit.
sankey wrote:So I tried mimicking your project by creating a Body, creating a new Sketch
That was unnecessary, I simply picked the first file made in 0.17 that I could find.

OS: Ubuntu 16.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10460 (Git)
Build type: None
Branch: master
Hash: 91c59c7910436c44ede608e29d9a90a287121a11
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Attachments
cargo_bike_normandc1.fcstd
(33.87 KiB) Downloaded 61 times
User avatar
wandererfan
Veteran
Posts: 6317
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: parametric dimensions of sketch in TechDraw

Post by wandererfan »

sankey wrote:Do you mean select the sketch and click the button "Insert a new View of a Part in the active drawing"?
Exactly. What you should see is:
cargo_bike_sankey.png
cargo_bike_sankey.png (198.39 KiB) Viewed 3478 times
As for:

Code: Select all

App::Document::_RecomputeFeature(): Unknown exception in Feature "ProjItem" thrown
my guess would be that the OCC HLR algorithm failed. I'm running a somewhat newer version of OCC.

OS: Ubuntu 12.04.5 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10330 +4 (Git)
Build type: debug
Branch: deltaX
Hash: 4ea4a136d8d5c0ab4f5e92a9de793b7ff87b7fab
Python version: 2.7.3
Qt version: 4.8.1
Coin version: 3.1.3
OCC version: 7.1.0

Edit: added FCSTD file
Attachments
cargo_bike_sankey.fcstd
Forgot to attach the fcstd!
(27.95 KiB) Downloaded 46 times
User avatar
wandererfan
Veteran
Posts: 6317
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: parametric dimensions of sketch in TechDraw

Post by wandererfan »

NormandC wrote:But! That was my mistake, I mistook which view tool wandererfan was talking about. It's actually the one labelled Insert Projection Group in the TechDraw menu. Image TechDraw_NewProjGroup
Should be able to use plain old TechDraw_NewView. If not, I need to fix something.

wf
Post Reply