Passing Edge GUID to MatchSrf

I encountered a frustrating behavior when trying to pass an edge GUID to MatchSrf with the SelID option:

Command: _SelID
Object ID to select: eee8ee87-8906-4dc2-a48f-7da107c8cbac
1 curve added to selection.

The GUID is a valid ID for an edge of a surface. When I pass it to the SelID command directly, it successfully highlights the edge in the view port.

Command: _MatchSrf
Select untrimmed surface edge to change ( MultipleMatches ): _SelID
Object ID to select: eee8ee87-8906-4dc2-a48f-7da107c8cbac
No objects added to selection.

However when I pass it to the MatchSrf command, the GUID is not recognized.

My end goal is to find a programmatic way to invoke MatchSrf from a python script. I couldn’t find a way other than using the rs.Command on “MatchSrf”. However the above behavior blocks this approach too.

Any insights are appreciated!

Hi @Yulin_Li,

Brep edges do not have ids.

– Dale

Can you provide a simple .3dm file with the object you want to edge highlight?

Hi Terry,

I’m not trying to do this task interactively. I have written a python script to create surfaces programmatically. Basically:

brep = rg.Brep.CreateEdgeSurface([crv1, crv2, crv3, crv4])

However, when I need to match two surfaces thus created, I don’t see an API for it in the SDK. I tried to work around it by calling this in python:

success = rs.Command(f"_-MatchSrf SelID {guid1} SelID {guid2} _Mode={mode} _PreserveOtherEnd=Nothing _MatchByClosestPoints={match_by_closestPoints} _RefineMatch=No _AverageSurfaces={average} _IsocurveDirection={isocurve_direction} _Enter", echo=True)

This doesn’t work since the edge guid is not recognized.

Hi Dale,

Please see my reply to Terry. Is there a way to invoke MatchSrf functionality from within python?

Hi @Yulin_Li,

Try using Brep.CreateFromMatch.

– Dale

Hi Dale,

Thanks! I will give it a try.