Per-project metrics

A forum for research and development of the user interface of FreeCAD
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Per-project metrics

Post by adrianinsaval »

To offer my 2 cents, I'll sugest having the units as a property of the document and then have an easy to acces drop down menu or something of the sort allowing you to choose between using the document's units or metric, imperial, whatever and a 'custom' option that opens the preference panel about units.
traverseda
Posts: 2
Joined: Sat Sep 22, 2018 12:31 pm

Re: Per-project metrics

Post by traverseda »

How about just changing the display? If I type 5ft 3 inches into a constraint, represent it internally in mm but leave the text as "5ft 3 inches".

Display mm on mouse over?

Unfortunately here in Canada we do end up having to mix units a lot, and it seems cleaner to me to make sure everything is displayed as what it actually is. 5 foot three inches might technically be 1600.2 mm, but that doesn't help if I'm converting a technical document from an imperial source.
mtsinc
Posts: 25
Joined: Tue Apr 24, 2018 12:40 pm

Re: Per-project metrics

Post by mtsinc »

I should mention that I managed to get FreeCAD to manage unit systems per-project. Several months ago, in fact.

I haven't attempted to offer it, however, because even though I can shift the metrics internally, there's not any good event I can find to fire to cause the change to propagate when switching view panes. This is especially noticeable when opening a project file.

It would be nice if there was something for this. For one thing, even with the current every-project-the-same setup I've seen the units changes lag on recent production releases.
mtsinc
Posts: 25
Joined: Tue Apr 24, 2018 12:40 pm

Re: Per-project metrics

Post by mtsinc »

While this is off-topic, I would like to express my overwhelming gratitude for the FreeCAD "link" feature. It has made my life a lot more pleasant.

Unfortunately, FreeCAD still persists on per-instance metric systems over per-document metric systems. And it continues to be about my biggest complaint.

It wasn't that hard to store metric info in the document files or to apply it to the metric core of FreeCAD. However, to be truly useful, it's necessary that when you have multiple documents open using different metric rules, that some sort of event be broadcast telling the metric core and the property displays that the rules for the currently-displayed document tab should be switched in as you go from tab to tab.

There's obviously some existing mechanisms, since you can change your metric system via the master properties dialog and the UI will update, but I haven't been able to make that work as an internally-invoked function fired from the tab-activation logic. I need something I can broadcast the change to.

If anyone can help out on that, I'd be really grateful.
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: Per-project metrics

Post by chrisb »

mtsinc wrote: Thu May 20, 2021 9:18 pm If anyone can help out on that, I'd be really grateful.
You can use different instances of FreeCAD using different config files. All metric stuff is then edited in the metric instance and imperial models are modeled in the imperial instance. Instead of switching tabs it is switching applications.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
mtsinc
Posts: 25
Joined: Tue Apr 24, 2018 12:40 pm

Re: Per-project metrics

Post by mtsinc »

chrisb wrote: Thu May 20, 2021 11:01 pm
mtsinc wrote: Thu May 20, 2021 9:18 pm If anyone can help out on that, I'd be really grateful.
You can use different instances of FreeCAD using different config files. All metric stuff is then edited in the metric instance and imperial models are modeled in the imperial instance. Instead of switching tabs it is switching applications.
Sorry I didn't see this earlier. The point isn't so much the tab-switching as the idea that each document knows its own metrics.

I've a similar gripe when developing with the Arduino IDE in that I work with a lot of different processors and the first thing I have to do when I load a project is manually select the processor. I've had to resort to adding comments to the code to remind me whicch processor/processor variant to select.

Computers are supposed to provide automation. It's one of their primary characteristics.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Per-project metrics

Post by adrianinsaval »

I think this would be a very useful feature, do you have a repository were one could look a what you already did? I know nothing of how this work but if I could at least see what you already did maybe I (or someone else) could figure out what else is needed, no promises from me though.
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: Per-project metrics

Post by chrisb »

mtsinc wrote: Mon Jul 26, 2021 1:03 pm Sorry I didn't see this earlier. The point isn't so much the tab-switching as the idea that each document knows its own metrics.
For exchanging documents this could be helpful.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
actuatedgear
Posts: 3
Joined: Wed Dec 22, 2021 8:01 pm

Re: Per-project metrics

Post by actuatedgear »

I wanna get this because I'm constantly swapping between metric for my 3d prints and Freedom units for wood hobby projects around the house, and typing "*25.4" 400 times gets... old.

Okay so, I want to talk about how we'd actually do this. It seems fairly straightforward. You could have a system default per the general settings menu which is what everything would start as. As for the per project settings, the most appropriate location would seem to be the properties sheet. You would simply select from a drop down menu in one of lines on the table for the object properties and then the project would read each object hierarchically.

One could in theory extend this downwards towards individual bodies, but that sort of thing tends to get... Well it's a great way to screw something up.

I'm not familiar with python, but it seems as simple as one added value stored on save file and... like two to four else if statements and... the drop down dialogue in the properties sheet which is a bit beyond my ken, but should be straighforward. Seems simple enough if you know where to look. Anyone mind at least checking my thinking?
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Per-project metrics

Post by jmaustpc »

actuatedgear wrote: Wed Dec 22, 2021 8:18 pm and typing "*25.4" 400 times gets... old.
Just replying to that comment....

Well don't then... :)

The units system understands and converts display units according to your settings and underneath it is always metric, I think you understand that, however you don't appear to understand that it also understands and converts units in data input. So for example if you have FreeCAD displaying USA customary units, but you wanted to add something that was for example 100mm, the just enter 100 with the mm units as well, Freecad will accept that metric input then convert and display USA customary units. Of course it works the other way around as well.
Post Reply