Extract brep vertices in GHPython

I’m GHPython beginner and I need your help.
I tried to made deconstruct brep component to GHPython, but extract vertices part doesn’t work.

input = brep
item acess
type hint = brep

I search RhinoScriptSyntax and found some codes but it doesn’t work.
PolylineVertices(curve_id, segment_index=-1)

2025.09.05.gh (12.5 KB)

code
import Rhino

verts =
edges =
faces =

if brep:
if isinstance(brep, Rhino.Geometry.Brep):
verts = [v.Location for v in brep.Vertices]
edges = [e.EdgeCurve for e in brep.Edges]
faces = [f for f in brep.Faces]

a = verts
b = edges
c = faces

Are the vertices just not in .Vertices? Can you extract them from each edge and dedupe them?

It has vertices. When i use ‘Deconstruct brep’ component, extract vertices.

I tried to extract vertices in edge but doesn’t work. Not only Line-like Curve but also Polyline, Linecurve too.

import rhinoscriptsyntax as rs

import Rhino



curves = x if isinstance(x, list) else [x]



all_points = []



for crv in curves:

    if crv is None: 

        continue

    

    if isinstance(crv, Rhino.Geometry.PolylineCurve):

        pts = [pt for pt in crv.ToPolyline().ToArray()]

        all_points.extend(pts)

    

    elif isinstance(crv, Rhino.Geometry.LineCurve):

        all_points.append(crv.PointAtStart)

        all_points.append(crv.PointAtEnd)

    

    elif isinstance(crv, Rhino.Geometry.ArcCurve):

        all_points.append(crv.PointAtStart)

        all_points.append(crv.PointAtEnd)

        all_points.append(crv.Arc.MidPoint)

    

    elif isinstance(crv, Rhino.Geometry.Curve):

        pline = crv.ToPolyline(0,0,0,0,0,0,True)

        if pline: 

            all_points.extend([pt for pt in pline])

        else:

            all_points.append(crv.PointAtStart)

            all_points.append(crv.PointAtEnd)



a = all_points

2025.09.05.gh (16.1 KB)

You can use the Brep.DuplicateVertices method:

2025.09.05.gh (5.5 KB)

I use Python 3, so your version is quite different from mine. But thanks for your advice.

I solved this problem.

Only the first variable had an error, so I made it blank and pushed back a space at a time.

Does anyone know why this kind of error happens?

While the new CPython 3 component has its quirks/issues when implementing RhinoCommon/.NET, in this case it works the exact same as the GhPython/IronPython version:

I checked that your code works. This kind of error is another problem.
Thanks to you, I learned new knowledge about RhinoCommon/.NET.
Have a nice day!