MoI discussion forum
MoI discussion forum

Full Version: Dimension tool (as in sketchup)

Show messages:  1-17  …  38-57  58-77  78-97  98-117  118-137  138

From: archetype (FABIENF)
19 Jul 2015   [#98]
Hi Max,

Another amazing script, thanks! Very useful indeed!

I really like christian's suggestion above, especially if the rectangle would snap to specific distances, so you can neatly place all annotations at the same distance from your drawing.

Ideally, we'd be able to set the offset from the text relative to the line, as well as the offset of the 'overshoot' of helper lines - usually you'd have this, instead of placement at very the end of these lines.

Thanks again, kind regards,

Fabien
From: ed (EDDYF)
19 Jul 2015   [#99]
A wonderful script Max. I think Christian & Fabien have valid ideas.

Ed Ferguson
From: Andrei Samardac
22 Jul 2015   [#100]
Hi,
I just created command that Show/Hide Dimensions. It toggles visibility of dimensions.
If all dimensions are hidden they will be shown else they will be hidden.
Command - Styles_ShowHideDimensions

Download it here:
http://bit.ly/1SCvfJP

Also in archive there is modified original dimension script.
It will unhide all Dimensions if they was hidden when you run command.

Max if you want you can keep this modification in future releases there is function at the end of _Dimensions.htm called ShowDimensions().
From: Frenchy Pilou (PILOU)
13 Sep 2015   [#101]
Does it possible to have something (or a trick) for have number of decimals wished?

Because edit the "round" function of the _Dimensions.htm manually is some painful ! ;)
Here you must change the "2" with number of decimals wished!
angle = round arc.angle, 2)
fixedDist:round(dist, 2);
fixedDist = round(R, 2);
From: bemfarmer
13 Sep 2015   [#102] In reply to [#101]
A little study and learning shows:

Line 21 of the .htm file has the round function, which rounds the val number to p decimals.
The function is called from 3 locations, line 52, 152, and 156, where p = 2, or p=2, or for angles, p=1.
I inserted the hard code "p+=2;" in Line 21, which raises decimals to 4, or 4, or for angles, 3decimals.


Test modification of line 21 of .htm file: function round(val, p) { p+=2; return Math.round(val*Math.pow(10, p))/Math.pow(10,p) }

I believe another user input could be added, for the desired decimals. But should 3 different user inputs be added, including one for angles?
Maybe 3 default values would be needed too?

I am not going to mess with Max's superb code :-)

- Brian
From: Max Smirnov (SMIRNOV)
14 Sep 2015   [#103]
>>Here you must change the "2" with number of decimals wished!
:) Ok, boss
From: Frenchy Pilou (PILOU)
14 Sep 2015   [#104] In reply to [#103]
>> :) Ok, boss

You rocks!
French Version : http://moiscript.weebly.com/cotations.html



PS Here 10...
Seems 14 is the Maximum possible! So suffucient I presume! :)
So maybe you can change the 4 in 14! (line 282) ;)
From: Max Smirnov (SMIRNOV)
14 Sep 2015   [#105] In reply to [#104]
No-no-no. :)
In fact nobody uses more than 2 digits after decimal point.
From: Frenchy Pilou (PILOU)
14 Sep 2015   [#106] In reply to [#105]
@Max (imum)
You don't know perversity of some geometric's maniacs! :D
So my version will be customized with funny thing max="14" (line 282) :D
From: Frenchy Pilou (PILOU)
14 Sep 2015   [#107]
And for Type 4 & 5 with CTRL seems we must make this! (THX Chri)
if ( arrowType.value == 4 || arrowType.value == 5 ) { f = moi.VectorMath.createPoint (c.x+dx, c.y+dy, c.z+dz ); fixedDist = round(R, 2); }

by

if ( arrowType.value == 4 || arrowType.value == 5 ) { f = moi.VectorMath.createPoint (c.x+dx, c.y+dy, c.z+dz ); fixedDist = round(R, decimals.value); }


Ps I don't know if all that work for Imperial ? Never used, too complex for me! :(



From: Max Smirnov (SMIRNOV)
14 Sep 2015   [#108] In reply to [#107]
Yes. Missed one Round call. Fixed and uploaded.
From: BurrMan
14 Sep 2015   [#109] In reply to [#106]
""""""""So my version will be customized with funny thing max="14" (line 282) """""""""""""""

Mine is set to "15" and outputs 15....

I also set my default at 4 and wrote in to default with "units" checked and also to have "in" as the trailer.......
From: Frenchy Pilou (PILOU)
14 Sep 2015   [#110] In reply to [#109]
you right 15 seems the ultime limit :)
From: toggi
12 Oct 2015   [#111] In reply to [#103]
wow. that script is phantastic. thanks a lot!
that really will save me a lot of time.
From: JL82 (JML82)
20 Dec 2015   [#112]
the script is not working for me. I got the script error. The language is Finnish.


Image Attachments:
Moi3d-2.JPG 


From: Michael Gibson
21 Dec 2015   [#113] In reply to [#112]
Hi JL82,

re:
> the script is not working for me. I got the script error.

From the error it looks like you are running MoI version 2, and I think the script requires MoI version 3 in order to run properly.

- Michael
From: JL82 (JML82)
21 Dec 2015   [#114] In reply to [#113]
Yes, I have version 2.
From: GonzoRus
2 Apr 2016   [#115] In reply to [#114]
Hello everybody.

The distance, the red arrow can be changed? Between the dimension line and digits?

Through editing files "_Dimensions.htm" or "_Dimensions.js"?


Image Attachments:
Change_the_Distance.png 


From: Frenchy Pilou (PILOU)
2 Apr 2016   [#116] In reply to [#115]
I am affraid not yet but just select and move it! ;)
From: Michael Gibson
2 Apr 2016   [#117] In reply to [#115]
Hi GonzoRus,

> The distance, the red arrow can be changed? Between the dimension line and digits?
>
> Through editing files "_Dimensions.htm" or "_Dimensions.js"?

Yes it's possible to change that spacing by editing the _Dimensions.htm file.

Using the latest version Dimensions.v.1.0.2015.09.14.zip which you can get from here: http://moi.maxsm.net/media/files/ , you would want to modify line #135 which sets the placement of the text.

135:     textframe.origin = frame.evaluate(textShift, (1-2*(angle>=180))*(lineWidth+textSize/3)/2, 0);

You would want to add something to the 2nd parameter to frame.evaluate(), like this for example (see the bold text for the + 1 that is added):

135:     textframe.origin = frame.evaluate(textShift, (1-2*(angle>=180))*(lineWidth+textSize/3)/2 + 1, 0);


- Michael

Show messages:  1-17  …  38-57  58-77  78-97  98-117  118-137  138