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

Get the index of a BREP vertex in Rhinocommon

$
0
0

@jeffoulet wrote:

Hi all,
I'm really new to Python/Rhinocommon and I'm trying to get the index of a BREP vertex by picking it. I've already this code, but it only returns the index of the edge where the point is picked.

    import rhinoscriptsyntax as rs
    import Rhino
    import scriptcontext as sc


    def GetBrepVertexIndex():

        gp = Rhino.Input.Custom.GetPoint()
        gp.SetCommandPrompt("Pick point")
        gp.Get()
        if gp.CommandResult() <> Rhino.Commands.Result.Success:
            return gp.CommandResult()
        brep = gp.PointOnObject()

        print brep.ObjectId
        print brep.GeometryComponentIndex.ComponentIndexType
        print brep.GeometryComponentIndex.Index

    GetBrepVertexIndex()

Is there any way to get this information?

Many thanks in advance?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 5938

Trending Articles