Zoom to physical size

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!
User avatar
M4x
Veteran
Posts: 1472
Joined: Sat Mar 11, 2017 9:23 am
Location: Germany

Re: Zoom to physical size

Post by M4x »

Creating a drawing with TechDraw could be useful too.
koirat
Posts: 66
Joined: Tue Oct 05, 2021 5:24 pm

Re: Zoom to physical size

Post by koirat »

Script works, thank you.
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Zoom to physical size

Post by TheMarkster »

https://github.com/FreeCAD/FreeCAD/pull/5125

This PR adds Mario's kisolre's macro to the View menu:
Snip macro screenshot-e4c5c2.png
Snip macro screenshot-e4c5c2.png (93.96 KiB) Viewed 1312 times
If someone wants to build it and test it that would be nice. It doesn't work properly on my build machine, which is running inside a virtual machine, but neither does the macro and it works on my host machine.
Last edited by TheMarkster on Sun Oct 24, 2021 6:51 pm, edited 1 time in total.
mario52
Veteran
Posts: 4673
Joined: Wed May 16, 2012 2:13 pm

Re: Zoom to physical size

Post by mario52 »

Hi

good addition tanks but :
TheMarkster wrote: Sat Oct 23, 2021 11:41 pm This PR adds Mario's macro to the View menu:
this is not Mario's macro this is very good kisolre's macro ([FEATURE REQUEST] Life-size view ?)

there is with FreeCAD the scale view (by carlopav)
carlopav wrote:ping
scaleView00.png
scaleView00.png (5.08 KiB) Viewed 1262 times
but give the error and not run

13:40:57 Traceback (most recent call last):
13:40:57 File "C:\FreeCAD_weekly-builds-25943-Win-Conda_vc14.x-x86_64\Mod\Draft\draftutils\init_draft_statusbar.py", line 171, in _set_scale
13:40:57 scale_widget.scaleLabel.setText(text_scale)
13:40:57 AttributeError: 'NoneType' object has no attribute 'scaleLabel'


OS: Windows 10 (10.0)
Word size of FreeCAD: 64-bit
Version: 0.20.25943 (Git)
Build type: Release
Branch: master
Hash: a65464b722a846bd2999aa2fecdff1132b15b297
Python version: 3.8.12
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.2
Locale: French/Mars (fr_MA)

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.
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Zoom to physical size

Post by Roy_043 »

mario52 wrote: Sun Oct 24, 2021 11:58 am FreeCAD the scale view
This widget has nothing to do with scaling the view. See Draft_annotation_scale_widget.
I have no issue with the widget. But we would probably need a step-by-step scenario to verify.

Code: Select all

OS: Windows 8.1 Version 6.3 (Build 9600)
Word size of FreeCAD: 64-bit
Version: 0.20.26155 (Git)
Build type: Release
Branch: master
Hash: 0926a4148bcff11249fd4f56bc30256102ffe105
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: Dutch/Netherlands (nl_NL)
mario52
Veteran
Posts: 4673
Joined: Wed May 16, 2012 2:13 pm

Re: Zoom to physical size

Post by mario52 »

Hi

ok but not work (tested by Draft_Text)

20:05:56 Traceback (most recent call last):
20:05:56 File "C:\FreeCAD_weekly-builds-25943-Win-Conda_vc14.x-x86_64\Mod\Draft\draftutils\init_draft_statusbar.py", line 171, in _set_scale
20:05:56 scale_widget.scaleLabel.setText(text_scale)
20:05:56 AttributeError: 'NoneType' object has no attribute 'scaleLabel'

TheMarkster wrote:ping
Based on a macro from mario52:
if you want to correct the name (first post github) of the real author kisolre

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.
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Zoom to physical size

Post by TheMarkster »

mario52 wrote: Sun Oct 24, 2021 6:06 pm Hi

ok but not work (tested by Draft_Text)

20:05:56 Traceback (most recent call last):
20:05:56 File "C:\FreeCAD_weekly-builds-25943-Win-Conda_vc14.x-x86_64\Mod\Draft\draftutils\init_draft_statusbar.py", line 171, in _set_scale
20:05:56 scale_widget.scaleLabel.setText(text_scale)
20:05:56 AttributeError: 'NoneType' object has no attribute 'scaleLabel'

TheMarkster wrote:ping
Based on a macro from mario52:
if you want to correct the name (first post github) of the real author kisolre

thanks

mario
I have corrected on github and in comments in the code to give proper credit to kisolre.
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: Zoom to physical size

Post by carlopav »

mario52 wrote: Sun Oct 24, 2021 6:06 pm ok but not work (tested by Draft_Text)

20:05:56 Traceback (most recent call last):
20:05:56 File "C:\FreeCAD_weekly-builds-25943-Win-Conda_vc14.x-x86_64\Mod\Draft\draftutils\init_draft_statusbar.py", line 171, in _set_scale
20:05:56 scale_widget.scaleLabel.setText(text_scale)
20:05:56 AttributeError: 'NoneType' object has no attribute 'scaleLabel'
Can you post the steps to reproduce? I also do not experience problems with the scale widget...

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.26035 +4 (Git)
Build type: Release
Branch: Draft_newSubelementMove
Hash: e26b6c04f887bacb5bceba5a1e9dfb4a87bd15a4
Python version: 3.8.6+
Qt version: 5.15.1
Coin version: 4.0.1
OCC version: 7.5.0
Locale: Italian/Italy (it_IT)
follow my experiments on BIM modelling for architecture design
mario52
Veteran
Posts: 4673
Joined: Wed May 16, 2012 2:13 pm

Re: Zoom to physical size

Post by mario52 »

Hi

@carlopav only if the widget is in top toolBar

scaleText00.gif
scaleText00.gif (706.94 KiB) Viewed 1082 times

other : if the widget is below, i reduce FC after i restore FC the widget is positionned in top toolBar


OS: Windows 10 (10.0)
Word size of FreeCAD: 64-bit
Version: 0.20.25943 (Git)
Build type: Release
Branch: master
Hash: a65464b722a846bd2999aa2fecdff1132b15b297
Python version: 3.8.12
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.2
Locale: French/Mars (fr_MA)

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.
Post Reply