MoI discussion forum
MoI discussion forum

Full Version: Dimension tool (as in sketchup)

Show messages:  1-13  14-33  34-53  54-73  74-93  …  134-138

From: Max Smirnov (SMIRNOV)
28 Jun 2015   [#14]
Script update. Fixed few bugs. Changed internal structure. Script modifications should be easier.

Frenchy Pilou
>> Must I draw them separately ?
Yes, you should draw them manually.

>>And alas we can't use the Helpers lines for align because of the second click ! :)
You can use LockConstructionLine script
code:
var cln =0, gd = moi.geometryDatabase, cl = gd.getObjects().getConstructionLines(), cll = cl.length; 
for (var i=0; i<cll; i++) if (!cl.item(i).isTemporary) cln++; if (cln == cll) { gd.removeObjects(cl) } else { cl.setProperty( "isTemporary", false ) }

Bind it to key. Draw construction lines. Run script (the lines will be locked). Run script again to delete the lines.

Hamish, Chri, phlatt5th
Thank you :)
From: Frenchy Pilou (PILOU)
28 Jun 2015   [#15] In reply to [#14]
Cool!
French version Updated! :)
http://moiscript.weebly.com/cotations.html
From: krass
28 Jun 2015   [#16]
Max, that's fine!
This is what the Bolsheviks were dreaming! ))))
I download and run the testing. Thank you very much!
You are, as always, is a genius!
From: Max Smirnov (SMIRNOV)
29 Jun 2015   [#17]
Forget to say about hidden features.

Double click title to load default values
Double click "Scale" to reset scale.
From: Frenchy Pilou (PILOU)
29 Jun 2015   [#18] In reply to [#17]
All day a nice surprise! :)
From: Mik (MIKULAS)
29 Jun 2015   [#19]
Beautiful script, Max!

as usual... :-)

Thanks for sharing.

Mik
From: MajorGrubert (CARLOSFERREIRAPINTO)
29 Jun 2015   [#20]
Thanks a lot, Max. Its quite usefull.
From: eric (ERICCLOUGH)
29 Jun 2015   [#21] In reply to [#14]
Hi Max ..

Does this insert into the original script and if so, where?

Or does it replace all or part of it?

thanks,
eric
From: Frenchy Pilou (PILOU)
29 Jun 2015   [#22] In reply to [#21]
Maybe like this
Just put it inside the Right Columm of a new ShortCut
but write "script:" on the beginning of the line!
So
script:var cln =0, gd = moi.geometryDatabase, cl = gd.getObjects().getConstructionLines(), cll = cl.length;
for (var i=0; i<cll; i++) if (!cl.item(i).isTemporary) cln++; if (cln == cll) { gd.removeObjects(cl) } else { cl.setProperty( "isTemporary", false ) }

Launch the Dimension Script
Call the script of persistant lines
Draw your helper lines
Draw your Dimension
Draw your helper lines
Draw your Dimension
etc
ps I have no more the Button OK that is normal ?


From: Michael Gibson
29 Jun 2015   [#23] In reply to [#5]
Great job Max, thanks for making this available!

- Michael
From: Max Smirnov (SMIRNOV)
29 Jun 2015   [#24]
Added new arrow types.
The type can be switched dynamicaly by pressing "1", "2", "3" keyboard keys.

From: Max Smirnov (SMIRNOV)
29 Jun 2015   [#25]
Frenchy Pilou
> I have no more the Button OK that is normal ?
Yes, it's normal.

eric
>> Does this insert into the original script and if so, where?
>> Or does it replace all or part of it?
No, it's a separate script, which can be useful with Dimensions script.
As Pilou said above, you can bind it to keyboard button.

Michael
Thank you :)
Could you help me? I have problem with pointpicker snapping. Is there a way to exclude all objects with "Dimensions" style from the object snapping list?
From: Frenchy Pilou (PILOU)
29 Jun 2015   [#26]
French version Updated! :)
http://moiscript.weebly.com/cotations.html


Alt + 0216 = Ø ;)

When I draw something on a surface in the 3D view
dimension Text, arraws are not parallal to this surface!
I must draw inside the View Face!
From: Michael Gibson
29 Jun 2015   [#27] In reply to [#25]
Hi Max,

> Could you help me? I have problem with pointpicker snapping. Is there a way to exclude
> all objects with "Dimensions" style from the object snapping list?

You can do that by making a pass through those objects before using the pointpicker, and turn off the "hit test" flag on each of those objects using: obj.setHitTest( false );

If an object is set with the "no hit test" flag, it should cause the pointpicker to skip over it and not target any snaps on it, and also it won't be targeted for selection either. Then if you want it to behave normally later on afterwards you'll need to set obj.setHitTest( true ); on those same objects to reset it.

If you do not have the objects already separated out somehow, you can find the style index of the "Dimensions" style by using:

code:
var style = moi.geometryDatabase.findStyle( 'Dimensions', false /*CreateIfNotFound*/ );
if ( style )
{
    var index = style.index;

     // Now look for objects that have obj.styleIndex == index
}


Hope that does what you need!

- Michael
From: eric (ERICCLOUGH)
29 Jun 2015   [#28] In reply to [#22]
Thank you Frenchy ..

eric
From: Mik (MIKULAS)
30 Jun 2015   [#29]
Hi Max,

arrow type is nice feature.

...as Frenchy imply, it would be very useful to have two additional checkboxes (same as Unit) "prefix" and "suffix" with text field for pasting symbols or additional text in front and behind of dimensions.

... and Arc drawing with angle value would be absolutely fantastic :-)

Excellent job, thank you.

Mik
From: wastzzz
30 Jun 2015   [#30]
A well made script. Quite useful while we wait for a proper dimension element.
M.
From: Frenchy Pilou (PILOU)
30 Jun 2015   [#31]

:)

Someone ask text before the dimension, also text in replacement of the dimension! (here text is after)

You can make that but...



From: Max Smirnov (SMIRNOV)
30 Jun 2015   [#32]
Michael
>obj.setHitTest( false );
Yes! That's exactly what I needed. Thank you! :)

Mik
>it would be very useful to have two additional checkboxes (same as Unit) "prefix" and "suffix"
I've made some changes in the new version ;)

v0.6
Snapping disabled for dimension lines (now script works exacly as planned)
Added more hidden features:
Prefix can be setted by using split symbol | in the units field. Example: R|mm -> R 15.1 mm

Pilou
>>Someone ask text before the dimension, also text in replacement of the dimension! (here text is after)
Special for you. :) Add * in the beginning. Example: *3/4 de pieds d'alouette!
From: phlatt5th (P5TH)
30 Jun 2015   [#33] In reply to [#32]
Max, brilliant!! Thanks again for the tweaks to the already awesome! script.
Cheers.

Show messages:  1-13  14-33  34-53  54-73  74-93  …  134-138