From: Matadem
Good day.
Is it possible in the future to have automatic dimension.
so instead of selecting horizontal or vertical or angle it automatically set the dimensions so you don't have to choose.
I think the new version of Freecad has this.
So this might speed up things quite a bit.
Thanks!
From: Michael Gibson
Hi Matadem,
re:
> Is it possible in the future to have automatic dimension.
> so instead of selecting horizontal or vertical or angle it automatically
> set the dimensions so you don't have to choose.
It's actually possible right now by installing this attached DimAuto plugin I just made.
Instructions for installing a plugin
here.
That will make a new command DimAuto available (requires MoI v5). The way it works is after you pick the 2nd point for the dimension there are 3 lines that will be radiating out from that point, one horizontal, one vertical and one aligned. Whichever one you are closest to for the 3rd pick will determine the type.
Looks like this:
Hope that helps!
- Michael
Updated to show warning message if not running on v5.
Attachments:
DimAuto.zip
From: Frenchy Pilou (PILOU)
Works fine with my little trick of 3D dimension!
Draw a plane by 3 points
AutoDIm (you must find the diagonal)
Hide or kill the plane
From: Barry-H
Hi Michael,
just tried Auto dimension script and got this error.
TypeError: undefined is not a constructor (evaluating 'moi.geometryDatabase.addConstructionLine( begin, end )')
DimAuto.js line 95
91: }
92:
93: function CreateCLine( begin, end )
94: {
95: >> var cline = moi.geometryDatabase.addConstructionLine( begin, end );
96: cline.setHitTest( false );
97:
98: return cline;
99: }
Also cant this function be achieved with the standard Aligned dimension tool anyway ?
Cheers
Barry
From: Grendel
Same here
Image Attachments:
Screenshot 2025-05-29 061905.jpg
From: 大道刀 (SUIYAN)
HI Michael
我建议这个脚本包含除了引线、文字之外的所有测量标注形式,至于使用哪种可以使用按钮(I suggest that this script include all measurement and annotation forms except for leaders and text. As for which one to use and which button to use)

Image Attachments:
1.jpg
From: Matadem
Thanks Michael.
Works efficient as usual.
One more question to speed my workflow.
How do I setup when I start a new drawing either in mm, cm , inch etc
so I can predefine the grid for each type of measurements?
Let say if it is in mm ...the grid is set at 1
if it is in cm the grid is set at 0.5
so every time I start Moi all is set.
Tnx!
From: Michael Gibson
Hi Barry & Grendel,
re:
> just tried Auto dimension script and got this error.
> TypeError: undefined is not a constructor (evaluating 'moi.geometryDatabase.addConstructionLine( begin, end )')
The script is using a new function in MoI version 5, you'll get this error if you are running it in v4 or earlier.
I'll update it to show a warning message and bail out if you're running it with v4.
> Also cant this function be achieved with the standard Aligned dimension tool anyway ?
Yes that's correct, this version is just a convenience function that determines whether to make it horizontal, vertical, or aligned by the location of the 3rd point pick instead of determining it by launching different "dim horizontal", "dim vertical" or "dim aligned" commands.
If you are placing a whole bunch of them it can speed things up since you can repeat this one command and control it by the 3rd pick.
- Michael
From: Michael Gibson
Hi SUIYAN,
re:
>(I suggest that this script include all measurement and annotation forms except
> for leaders and text. As for which one to use and which button to use)
The main purpose of this script is to avoid needing to specify what type to use and instead figuring it out automatically based on the position of the pick.
So it doesn't really fit with it to have type buttons inside of the "auto" command like that.
There are already different buttons for individual types in the main UI "Dim" palette.
- Michael
From: pressure (PEER)
Very nice!
From: Frenchy Pilou (PILOU)
French version done! )
In fact nothing to do, was yet there! :)
he new DimAuto uses the same UI as the DimHorizontal, DimVertical and DimAligned so it uses those already translated strings. :)
From: Michael Gibson
Hi Matadem,
re:
> How do I setup when I start a new drawing either in mm, cm , inch etc
>
> so I can predefine the grid for each type of measurements?
Currently grid properties are global. There isn't anything built in for storing them in a template file but you could set up a script to help with that.
> Let say if it is in mm ...the grid is set at 1
> if it is in cm the grid is set at 0.5
A script that would set this goes like this:
script: if ( moi.geometryDatabase.units == 'Millimeters' ) { moi.grid.size = moi.grid.snapSize = 1.0; } else if ( moi.geometryDatabase.units == 'Centimeters' ) { moi.grid.size = moi.grid.snapSize = 0.5; }
Or another possible way is you could set some values in document user text under File > Notes > Document user text and then the script could look there to get the size to set. Let me know if you want to try that way.
You can open a file as a template file by using right click on the File > Open instead of left click.
- Michael
From: Matadem
Good day...the second option looks like a better choice.
Question on the second choice...as soon as Moi starts it automatically look for the script or I need to activate it?
More automatic as possible would be great.
Tnx!
From: Michael Gibson
Hi Matadem,
re:
> Question on the second choice...as soon as Moi starts it automatically look for the script or I need to activate it?
If you're always starting up a new window for this then it should be possible to have the script automatically run by putting it in the appdata\startup folder.
If you want it to work on an already open window you would need to trigger it yourself.
- Michael
From: mk (MARKY)
Hi Michael,
Works like a charm.
Thank you,
Marek
From: Frenchy Pilou (PILOU)
on inclined plane! :)
From: Finema
Really cool this plugin.
Thanks a lot.