SetGeometryCurve method

Hi Dynamo Friends,
i will simplify my problem by this example:
i have a U shape made by Detail lines and i want to update the middle line to become half length but still joining to the other detail lines to keep getting the same U shape (but smaller).

i use SetGeometryCurve method from API :slight_smile:

def update_longest_line(longest_line, new_curve):
    # Start a transaction to modify the document
    TransactionManager.Instance.EnsureInTransaction(doc)
    
    # Update the longest line's geometry
    longest_line.SetGeometryCurve(new_curve, True)
    
    # End the transaction
    TransactionManager.Instance.TransactionTaskDone()
    return longest_line

i get succeded in update the midel longest line but without joining to the other lines,
So , is there any way to still keep joining the lines after update the geometery of longest line?

Thanks in advance for any help .

11

Any ideas?

@hanywillim

can you make a Detailelement where already a parameter inside for length ?

is there a deeper context ?

a transaction in a function is not the best way

rather i would make a function that extracts the new length

Thanks @Draxl_Andreas for your replay , Appreciated

For some reasons i have to use Detail group only.

just a text besides each detail curve represented the length value.

but even i extract the new length the longest line will not updated in the shape.

Thanks.