Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5745

Help with my Draw on face and extrude script

$
0
0

@DreamPsi wrote:

Ok heres the problem sometimes my script doesn't perform the operations for subtracting ect...

heres the script

import rhinoscriptsyntax as rs
import scriptcontext
import System
import select
opt = ("Subtract", "No", "Yes"),("Union", "No", "Yes"),("Split", "No", "Yes"),("Intersect", "No", "Yes")
Chk = rs.GetBoolean("Select",opt,(True,False,False,False))
#object to be subtracted from
print Chk
Subtract = rs.GetObject("Select Object to manipulate",False,True,None,False)
rs.Sleep(300)
rs.Command("CPlane _Surface")
rs.Command("Polygon")
Curve = rs.Command("SelLast")
rs.Sleep(300)
rs.Command("ExtrudeCrv")
subtracty = rs.FirstObject()
box = rs.BoundingBox(Subtract,rs.ViewCPlane(),False)
rs.Sleep(300)
print "check to see if objects intersect"
#some times it skips this part completely on certain sides/faces idk why
if Chk == (True,False,False,False):
    rs.BooleanDifference(Subtract,subtracty,delete_input=True)
    print "Subtracting"
if Chk ==(False,True,False,False):
    rs.BooleanUnion((Subtract,subtracty),False)   
    print "Unioning"
if Chk ==(False,False,True,False):
    rs.SplitBrep(Subtract,subtracty,False) 
    print "Spliting"
if Chk ==(False,False,False,True):
    rs.BooleanIntersection(Subtract,subtracty,False) 
    print "Intersecting"

rs.UnselectAllObjects()
print "BOoooyya"

I created this because I love the way sketchups pushpull tool worked and to speed up my flow

Posts: 3

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 5745

Trending Articles