Help with ExtendSrf using python script

Hello everyone,

I am currently facing an issue regarding ExtendSrf using python and Rhinocommon.
what I want to achieve is simple: select multiple edges of multiple surfaces and extend them all with same distance.

I initially wrote an python script to do it but it always untrim the surfaces before extend them, I would like to extend trimmed surfaces as well just like how the command “_ExtendSrf” would do.

So later I tried to first select multiple edges, then directly run command “_ExtendSrf” in python through “rhino.RhinoApp.RunScript”. But no matter what I do, it still asked me to manually select edges to extend.

I appreciate any insights or advice you can provide. Thank you in advance for your help!

fwt_Extend_Multiple_Srfs02_cmd.py (669 Bytes)
This is the py file

Hi, look at this script at this link. If this script doesn’t work, let me know. I can help

Thank you so much for the reply!!! I tried the python script attached, but it seems to simply skip all trimmed surfaces and then end

yes the script skips trimmed surfaces:

        if rs.IsSurfaceTrimmed(srf):
            skipped += 1
            continue
        else:

extending trimmed surfaces has many special cases and would be much more complex to be reliable.
untrim with keep boundary option, extend the underlaying surface if necessary.
Decide what to do with the trimming.

if you have 1000 parts that all have the same typology, post a sample so we do not need to discuss a general case.

kind regards - tom