Quicky Delete&Trim Tool/Command?

I think you do or you wouldn’t be going on about it.

Actually I was asking you to describe it better, reread your subject title and first post.

Point form maybe for us imbeciles.

  1. I would like a tool, when selected objects ( by paint brush,or magic wand or however )
  2. would be deleted or trimmed, my preference
  3. end tool

Yes Cya …

&

… don’t believe everything you think

I have fun with people who draw, no language barriers

then read:

it explains that the eraser tool is not doing what your proposed tool is doing.

that is but an effect of something at a more fundamental level in the program.
sketchup creates sticky geometry… rhino doesn’t…

in order to make rhino’s delete/trim tools work like sketchup’s eraser then you don’t have to change the delete or trim tool… you have to change the entire program at a root level… good luck with that.

the entire point of me posting that was to make the point that sketchup does not have a trim tool… its eraser is only a delete tool… because everything is already split when it’s created. (and a trim tool is delete ANd split combined into one tool)

whether or not a certain functionality could or should be mimicked in rhino has nothing to do with what i said… i was discussing a core difference between sketchup’s workflow/ideology and rhino’s.


i don’t know what to tell you man… you’re apparently offended by my posts… what you read from them are taken as me being on the high horse and calling you names… firing insults… etc.
it’s some serious communication breakdown going on.

Thanks, from me as well … all I wanted was a better explanation of what he wanted.

“Cool Hand Luke” … what we have here is a failure to communicate

Here ya go…

import Rhino
import rhinoscriptsyntax as rs

def GetOneOrMoreObjects(prompt):
    #prompt==command line prompt
    go = Rhino.Input.Custom.GetObject()
    go.SetCommandPrompt(prompt)
    go.EnablePressEnterWhenDonePrompt(False)
    get_rc = go.GetMultiple(1,-1)
    if get_rc==Rhino.Input.GetResult.Object: return go.Objects()
    return

while True:
    objs=GetOneOrMoreObjects("Select objects to delete")
    if objs: rs.DeleteObjects(objs)
    else: break
1 Like

[quote=“RichardZ, post:56, topic:38556”]
a script which did both deleting and trimming in one go without any selection of trim objects?
[/quote/

No, as script for repeatedly delete objects only.
… But I lke the idea of a single click quick-trim, when the object only has one intersection …

Whether ideas in Rhino are good or bad it’s only a problem of priority IMO.
We all know that RMA has limited resources, they cannot implement several things just because they have not enough time.
… And obviously because they generally don’t use external libraries (for good reasons), but write a lot of code in house.
If you also take in account that Rhino is used for a lot of different purposes, you quickly realize that picking the features to implement is not a trivial task for Bob … :smiley:

… But anyway, as I said, I like the idea of a quick trim, but I have no idea how hard it would be to write it …
and also to precisely define what it would need to do …

and how often shall i do that? when i keep repeating the same things over and over again it gets boring. especially when i have to start discussing general and well know facts of how to use trim or how to delete.

to repeat once more also as you pointed out yourself a tool which deletes and trims objects on touch.
according to your preference with no disadvantage to tools used prior. thats the idea and i believe that could be very smooth.

and to point that out one last time, i am not longing for a recreation or to produce sticky geometry. all that is there in rhino shall be done the same just a bit more handsome to call it like that at least that would be the wish for it.

1 Like

merci beaucoup monsieur Helvetosaur_e :smile_cat: that works very fine now as i wished, while getting something to read and compare. maybe if i understand Python soon enough hopefully i could combine yours and Pascals to one funky tool.

if Emilio does not find his anymore

yes thats true in any matter, but if there is something which causes no disadvantages and only enhances positively then i should hope it would be considered rather sooner than later.

hmm i personally have not much knowledge about coding, i only know a bit CSS and a dash of javascript maybe not even enough to understand it. but anway if such a tool would be lets say even though a bit more extensively due to the core language but still similar easy in its idea like the Python pendants here then maybe its even feasible in quite a short time. but then again as you say i am sure there are many opinions on what to implement and what not, and so far i have not heard anything here regarding the consideration of it.

thanks to all for the lovely implementations and brainstormings. :roller_coaster:

Here ya go!
Delete first then trim …

import Rhino
import scriptcontext as sc
import rhinoscriptsyntax as rs

def GetOneOrMoreObjects(prompt):
    #prompt==command line prompt
    go = Rhino.Input.Custom.GetObject()
    go.SetCommandPrompt(prompt)
    go.EnablePressEnterWhenDonePrompt(False)
    get_rc = go.GetMultiple(1,-1)
    if get_rc==Rhino.Input.GetResult.Object: return go.Objects()
    return

while True:
    objs=GetOneOrMoreObjects("Select objects to delete")
    if objs: rs.DeleteObjects(objs)
    else: break

def TrimObjects ():
    Ids = rs.NormalObjects()
    rs.EnableRedraw(False)
    rs.SelectObjects(Ids)
    for Id in Ids:
        obj = sc.doc.Objects.Find(Id)
        obj.Highlight(False)

    rs.EnableRedraw(True)
    rs.Command ("_Trim")
    rs.UnselectAllObjects()

if __name__ == "__main__":
    TrimObjects() # Call the function defined above

Delete objects first …

right-click to enter trim command …

Cheers :crystal_ball:

DeleteAndTrim.py (836 Bytes)

Her is the script
It’s an old Rhino 4 rvb file: VBScript, not Python

function confirm(msg)
confirm=vbtrue
ok=rhino.getstring(msg&" Ok ?","Yes",array("Yes","No","Exit"))
if ok="Exit" then confirm=null:exit function
if ucase(left(ok,1))="N" then confirm=vbfalse
end function

sub rtn
obs=rhino.selectedobjects
if isarray(obs) then
  rhino.deleteobjects obs
  exit sub
end if
dim ar()
redim ar(-1)
do
  ob=rhino.getobject("Object ?")
  if isnull(ob) then exit do
  las=ob
  redim preserve ar(ubound(ar)+1)
  ar(ubound(ar))=ob
  rhino.hideobject ob
loop
ok=confirm("Last object picked")
if not ok then
  rhino.showobject las
  redim preserve ar(ubound(ar)-1)
end if
rhino.enableredraw false
rhino.showobjects ar
rhino.deleteobjects ar
rhino.enableredraw true
rhino.print cstr(ubound(ar)+1)&" objects deleted"
end sub

rtn

… But you’ll find nothing more than in the scripts by Mitch and Pascal.

Actually, I had not noticed Pascal’s script for trimming …
Very nice !
I’ll have to try that … :smiley:

Thank you @pascal

Yes, exactly.

Same for FIlletSrf and for selection in general.
Using FilletSrf in wireframe, is sometimes particularly difficult finding a point on a border/isocurve to pick, so that Rhino could build the desired surface.
Often it (silently) builds nothing at all, or keeps building the fillet on the wrong side

Trimmed surfaces are sometimes impossible to fillet, so that I have to build a temporary base surface to be able to build the fillet surf

Same for long/large surfaces, a temporary smaller surface (built trimming a copy of the original surface by isocurves) may be necessary.

I agree.

BTW, speaking of Trim and Split:

What about allowing the Split command to select first the splitting objects and then the object to split, when needed ?
I had to write a small script for that.
Sometimes you have to preselect the splitting objects.
… Well … Unless selection sets be introduced in Rhino :slight_smile:

Yes there are times when selection can be difficult. I have noticed the problem most often when the fillet comes to a point. Increasing isocurve density can help.
I usually work in wireframe, but sometimes the picking problem makes it faster to switch to shaded mode for making fillets, Picking for filletSrf was more robust in Rhino2.

It seems to me, that nothing is done until after the user has picked both sets so why does it matter which selection set is first?

Yes, but more isocurves on complex objects are confusing to me …
I would need to rise and then lower the isocurve number repeatedly for several objects … too complicated.

But I have to remember your suggestion about using shaded mode when needed.
In certain cases it can certainly help. :slight_smile:

Yes, unfortunately Rhino 3 was not able to keep Rhino 2’s smoothness …

For example, at times I have to split a large surface by many smaller (poly)surfaces.
And those splitting objects are already selected due to previous operations.
In this case running ‘SplitBack’ on the already selected splitting objects and simply select the object to split feels simple and fast.
Having to lose that selection to run Split, select the surface to split and finally reselect all those splitting objects (often a difficult/long task) … well, feels somewhat stupid. :wink:

Thank you, Jim !
Regards

Hi Emilio - SelPrev should help here - deselect, start Split, select the target surface, Enter, then SelPrev and Enter. Does that do it?

-Pascal

Yeeeeees, it works. :smiley:

Thank you Pascal !

EDIT:

BTW looks like I have problems understanding which command can be run inside which …:confused: