rs.Command() Suppress echo problem


(Nico de Meester) #1

Hi-

In the python code below I try to suppress the echos on the command line but it still shows the “command:” echo.
Is it possible to suppress this aswell?

##################################
import rhinoscriptsyntax as rs
import Rhino

def MergeEdge():
    ArrObject=rs.GetObjects("Select Parts",16)
    rs.EnableRedraw(False)
    for srf in ArrObject:
        rs.Command("_MergeAllEdges _SelId "+ str(srf) + " _Enter",False)
    rs.EnableRedraw(True)
if __name__ == "__main__":
    MergeEdge()
#####################################

(Dale Fugier) #2

Try preceding the command name with _NoEcho.

– Dale


(Nico de Meester) #3

Hi Dale

It Didn’t work.
I modified the commanline but still the command echo appear.

rs.Command("_NoEcho _MergeAllEdges _SelId “+ str(srf) + " _Enter”,False)

See attached files

–Nico

MergeAllEdges.py (323 Bytes)
MergeAllEdges.3dm (230.6 KB)


(Dale Fugier) #4

I am not seeing anything echoed to the command line, other than the Select Parts prompt.

What am I missing?

– Dale


#5

I’m seeing the same as Nico.

A Command: is printed for each repeat of the loop.

Also, an additional Select Parts. Press Enter when done: is printed after Enter is pressed.

For example, after window-selecting 4 surfaces at once and pressing Enter, this is printed:

Select Parts:
Select Parts. Press Enter when done:
Select Parts. Press Enter when done:
Command:
Command:
Command:

@Nico_de_Meester
A workaround is:

def MergeEdge():
    ArrObject=rs.GetObjects("Select Parts",16,select=True)
    rs.EnableRedraw(False)
    rs.Command("_MergeAllEdges",False)
    rs.UnselectAllObjects()
    rs.EnableRedraw(True)

Steve


(Nico de Meester) #6

Hi Dale

I got the same as what Steve showed.
When you want to merge for example 100 parts you probably got 100 Command: lines in the history.
But the workaround off Steve works.
So I am happy.
Thanks for you reactions.

Nico