Suppress Dialog box & options

Hi all,

i have a problem , i’m scripting _OrientOnSrf with rhino.command :

Rhino.command " _-OrientOnSrf …

i’m using dash to suppress dialog box, but Rhino behaves like if all was checked in dialog box and didn’t retain any previous setting , i must input a scale factor and rotation angle each time, obviously i want to avoid this.

is there a way to control what is checked , what is uncheked by script ?

Thx.

Anyone ? no ?

Ok, it’s more easy to choose in list :

A : it’s possible
B : it’s impossible
C : May be …
D : Perhaps …
E: I don’t know …
F : I don’t care …
G: E & F !
F : What are you talking about man ?
G : Blue
H : You can use “50/50” or “Phone a Friend”

The dash version seems to be working here…

You should be able to specify everything on the command line. There will be some work to do - you will need to have the ID of the surface you want to orient onto (either preselect or…) the insertion point on the surface and the rotation/scale numbers…

These all need to be put together into one long command string to be passed to Rhino.Command(). Sometimes it takes some experimentation to get the order of arguments in the string correct.

But here at least I do not get the dialog.

–Mitch

Hi Mitch,

Thanks for reply,

Yes, all is working for me, except i can’t control ( or i don’t know how ) settings in dialog box when i use dash

i would like to uncheck both prompt ( scale and rotation ) , but seems when i use dash all dialog box options are checked by default, i don’t find parameters to control that.

Any ideas ?

here is my line command :

Rhino.command " _-OrientOnSrf _selID " & arrObject & " _Enter " & Rhino.Pt2Str(arrP) & " " & Rhino.Pt2Str(arrVect) & " _selID " & arrSfr

You can’t do that, you will need to explicitly set the scale to 1 and the rotation to 0 in the command string, as well as all the other command line options in the correct order and formatting. Example:

VB (positively painful)

Call Test()
Sub Test()
    Dim obj,bp,rp,targ,tp,comm

    obj = Rhino.GetObject("Select object to orient")
    bp = Rhino.GetPoint("Base point")
    bp = Rhino.Pt2Str(bp)
    rp = Rhino.GetPoint("Reference point")
    rp = Rhino.Pt2Str(rp)
    targ = Rhino.GetObject("Select target object")
    tp = Rhino.GetPoint("Target point")
    tp = Rhino.Pt2Str(tp)

    comm = "_-OrientOnSrf _selID " & obj & " _Enter " & bp & " " & rp
    comm = comm & " _SelID " & targ & " _Copy=_Yes _Flip=_No _IgnoreTrims=_No"
    comm = comm & " _Rigid=_Yes " & tp & " 1.0 0.0 _Enter"
    Call Rhino.Print(comm)
    Call Rhino.Command(comm)
End Sub

Python (still painful, but much less so)

import rhinoscriptsyntax as rs

obj=rs.GetObject("Select object to orient")
bp=rs.GetPoint("Base point")
rp=rs.GetPoint("Reference point")
targ=rs.GetObject("Select target object")
tp=rs.GetPoint("Target point")

comm="_-OrientOnSrf _selID {} _Enter {} {} _SelID {} ".format(obj,bp,rp,targ)
comm+="_Copy=_Yes _Flip=_No _IgnoreTrims=_No _Rigid=_Yes "
comm+="{} 1.0 0.0 _Enter".format(tp)
rs.Command(comm)

–Mitch

Arrgghh !

Ok , i got my answer.

Thanks for help.

@Helvetosaur

Hi Mitch!

As part of the RhinoScript
How to make multi copy on surface
With blocking the dialog box, and scaling?
Is that possible?

I added a _Pause before the _Enter, but began scaling and creats only one copy.

Not sure I am understanding - you want to be able to set the scale to other than 1? You want to ask the user for a scale?

–Mitch

No.
I would leave the scale of one-to-one
1.0 0.0
lock dialog box,
lock scale
lock rotation,

Be able to add multiple identical copies.
Without rotation, and scale.
Now works only one copy on surfase.