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

[Python] sub object selection is not trimmed

$
0
0

@ivelin.peychev wrote:

Hi,

I was looking at this thread:

I tried using the scripts but something gets messed up.
When I extract the face and try to create a surface out of it the trim information is not passed on to the resulting surface.

This is what I do:

# get_brep_face.py
# created by Helvetosaur Mar 2014
# modified and adapted by zooid Mar 2019

import Rhino
import rhinoscriptsyntax as rs
import scriptcontext as sc

def GetOnlyBrepFace():
    msg="Select a surface or Brep face to offset"
    go = Rhino.Input.Custom.GetObject()
    go.SetCommandPrompt(msg)
    go.GeometryFilter = Rhino.DocObjects.ObjectType.Surface
    go.GeometryAttributeFilter=Rhino.Input.Custom.GeometryAttributeFilter.SubSurface
    go.SubObjectSelect = True
    go.AcceptNothing(False)
    
    if go.Get()!=Rhino.Input.GetResult.Object: return
    objref = go.Object(0)
    objrefsurf = objref.Surface()
    print objrefsurf
    if objrefsurf is not None:
        tmp_surf = sc.doc.Objects.AddSurface(objrefsurf)
        rs.UnrollSurface(surface_id=tmp_surf,explode=False,following_geometry=None,absolute_tolerance=None,relative_tolerance=None)
        rs.DeleteObject(tmp_surf)
        
    else:
        return
    #etc
    
GetOnlyBrepFace()

BrepFace:

Result:
image

Is there a way to pass on the trim information as well?

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 5894