I have created a script that merges 4 surfaces. I start merging surfaces 2 by 2 using the Rhino.Command “MergeSrf”. This works fine until I try to merge the last 2 surfaces using the exact same command. I have the following error message: Can’t determine which edges to merge. Pick near edges to merge.
I don’t understand why I have an error message as it works fine when I merge the 2 last surfaces manually in Rhino.
Attached are my 4 surfaces and the rvb file: Untitled.3dm (66.7 KB) Merge.rvb (549 Bytes)
You work on a name basis. After the MergeSrf command, the resulting merged surface gets the name of the first surface selected. It will probably work like this (remove the comments after the //)
Option Explicit
Dim obj1,obj2
obj1 = Rhino.ObjectsByName("PortBot", True) // first name is PortBot
obj2 = Rhino.ObjectsByName("PortTop", True)
Call Rhino.Command("MergeSrf obj1 obj2 _Enter")
Rhino.Command "_-SelNone", 0
obj1 = Rhino.ObjectsByName("StbBot", True) // first name is StbBot
obj2 = Rhino.ObjectsByName("StbTop", True)
Call Rhino.Command("MergeSrf obj1 obj2 _Enter")
Rhino.Command "_-SelNone", 0
obj1 = Rhino.ObjectsByName("PortBot", True) //use the first name from above
obj2 = Rhino.ObjectsByName("StbBot", True) // use the first name from above
Call Rhino.Command("MergeSrf obj1 obj2 _Enter")
Rhino.Command "_-SelNone", 0
Yes I understood this. This is the reason why the last MergeSrf was being done with “PortBot” and “StbBot”.
The last MergeSrf does not work and has the following error: Can’t determine which edges to merge. Pick near edges to merge.
I would like to understand and fix this error.
One question:
When I call Mergesrf in Rhino (i.e. manually) it does not ask me any edge to use and the merge succeeds.
Could you explain me why the script then needs to know which edges to use?