MoI discussion forum
MoI discussion forum

Full Version: Lots of unkown

Show messages:  1-19  …  60-79  80-99  100-119  120-139  140-159  160-179  180-199  …  360-372

From: Cemortan_Tudor
28 Jun 2020   [#120]
thanks ! I was missing ordering !
From: Cemortan_Tudor
1 Jul 2020   [#121]
I know in config it's possible to turn project orto, is it possible to script toogle without restarting ?
From: Michael Gibson
1 Jul 2020   [#122] In reply to [#121]
Hi Tudor, do you mean this setting in moi.ini ? :

ProjectOsnapsInOrthoViews=y

That property can be set by script at runtime at moi.drawingAids.objectSnapProjectInOrthoViews so to toggle it try this:

moi.drawingAids.objectSnapProjectInOrthoViews = !moi.drawingAids.objectSnapProjectInOrthoViews;

- Michael
From: Cemortan_Tudor
1 Jul 2020   [#123] In reply to [#122]
DisableOnSrfInOrtho
From: Michael Gibson
1 Jul 2020   [#124] In reply to [#123]
Hi Tudor, the runtime script property for that one is moi.drawingAids.disableOnSrfInOrtho

- Michael
From: Cemortan_Tudor
2 Jul 2020   [#125]
Thanks !
script: /* SurfaceInOrtho */ moi.drawingAids.disableOnSrfInOrtho = !moi.drawingAids.disableOnSrfInOrtho

Message 8665.126 was deleted


From: Cemortan_Tudor
2 Jul 2020   [#127]
Align Hotkeys
w - top
s - bottom
a - left
d - right
q - Vertical Center
e - Horizontal Center

Attachments:
Align.js


From: Cemortan_Tudor
2 Jul 2020   [#128]
wanna improve the align script !
my question is how do i get pointpicker.basept(or value of pointpicker after alignment without clicking) when I'm pressing second hotkey ( let's say I've aligned top, now I need right side -> not to run script twice )
From: Michael Gibson
2 Jul 2020   [#129] In reply to [#128]
Hi Tudor, the current point for the pointpicker can be accessed using the .pt property on it.

There is also a .cplane property for getting the construction plane (the grid plane) for the pick, and also .ptframe for getting a coordinate frame with its origin at the current point and the frame's axes in the cplane directions.

- Michael
From: Cemortan_Tudor
2 Jul 2020   [#130]
is that if clicked?
anything without clicking ? cuz if I click something, scripts ends it's action
otherworlds I need current pointposition without click

if (!wasAnyHotkey) {
moi.command.setOption( 'AlignMode', 'VerticalLeft' );
factory.setInput( 2, 'VerticalLeft' );
factory.update();
wasAnyHotkey = true;
}
else {
//here i need help !
pointpicker.pt = pointpicker.ptframe.origin ;
factory.commit();
DoAlign();
}
From: Michael Gibson
2 Jul 2020   [#131] In reply to [#130]
Hi Tudor,

re:
> is that if clicked?

No, it's available anytime the pointpicker has been able to get a point, like with mousemove.


> cuz if I click something, scripts ends it's action

Yes, that's how the regular Align command is supposed to work. When you click a point a 'finished' event will be triggered, and this part of the script exits the even loop when it sees that;

code:
	while ( 1 )
	{
		if ( !pointpicker.waitForEvent() )
			return;
			
>>>		if ( pointpicker.event == 'finished' )
>>>			break;
			

If you don't want the script to end when a point is clicked you would want to modify what it does with the 'finished' event, like ignore it.

- Michael
From: Cemortan_Tudor
3 Jul 2020   [#132]
Thanks Michael

Align Hotkeys
w - top
s - bottom
a - left
d - right
q - Vertical Center
e - Horizontal Center
added
align corners
ex: w+a/w+d/s+a/s+d

Attachments:
underTest_Align.js


From: Cemortan_Tudor
4 Jul 2020   [#133]
based on
https://github.com/arekm/rsdoc-to-sat

Convert DesignSpark Mechanical DSM rsdoc file to sat file which can be loaded into MoI3d
Installation -> python3

drag & drop rsdoc file(s) onto rsdoc-to-sat.py file
.sat file(s) will appear in the same directory as rsdoc file(s).

author went via winreg path, i've changed path inside script to full path ~
inside script change path of sabsat to full path of SabSatConverter.exe (it comes with full DSM installation)
~
sabsat = "C:\\Program Files\\DesignSpark\\DesignSpark Mechanical 4.0\\SabSatConverter.exe"
~

Attachments:
rsdoc-to-sat.py


From: Cemortan_Tudor
4 Jul 2020   [#134]
o hayo !
v4 new future crv.evaluateCurvature
I'm thinking about script for edge loop up to ~ broken curvature on a brep (on curve will be a sharp corner)
if i'm extracting curves, how shall i transfer back to edges ?
From: Michael Gibson
4 Jul 2020   [#135] In reply to [#134]
Hi Tudor,

re:
> if i'm extracting curves, how shall i transfer back to edges ?

Sorry I'm not sure I understand this - you can call curve evaluate methods on an edge curve just like you can on a "standalone" curve.

One thing to be aware of is that a curvature break between 2 edge curves does not mean anything about the continuity of the surface at that point. For example:



- Michael

Image Attachments:
tudor_edge_break.jpg 


From: Cemortan_Tudor
4 Jul 2020   [#136]
Shortcuts for manipulation:
Fillet; Inset; Shell ; Offset(Brep)

Numpad+ -> value + value/2
Shift+Numpad+ -> value + value/10
Numpad- -> value - value /3
Shift+Numpad- -> value + value/10
Numpad* -> value*value
Numpad/ -> value/value

Attachments:
GetDistance.js


From: Cemortan_Tudor
4 Jul 2020   [#137]
http://moi3d.com/wiki/V4Beta
Scripting:
Added additional script interface for Curve and CurveSegment objects.
For both Curves and CurveSegments:

wasn't any mention about edges, will try !
From: Cemortan_Tudor
4 Jul 2020   [#138]
About align - 3d viewport -> I think it should be aligned along camera position - not along axis
From: Michael Gibson
4 Jul 2020   [#139] In reply to [#137]
Hi Tudor,

re:
> wasn't any mention about edges, will try !

Edge curves and "standalone" curves have the same curve interface object.


> About align - 3d viewport -> I think it should be aligned along camera position - not along axis

Can you show an example of what you mean?

- Michael

Show messages:  1-19  …  60-79  80-99  100-119  120-139  140-159  160-179  180-199  …  360-372