Explode Block List Help

So in Python if I use the rs.ExplodeBlockInstance() in the help menu it says it returns a list, but if I try and use the pop() function it doesn’t work. If I look at the property types it says the list created is a system.guid, which I am not sure what that is??? Is there a way to convert this to a regular list so I can use list functions on it?

This is another one of those “bugs” where Python should be returning a normal list and not a specialized list object like system.guid[] IMO… @stevebaer

I think the workaround would be something like this (haven’t tested):

explode=[explode[i] for i,element in enumerate(explode)]

Which I think should create a new normal list of guids… Maybe there’s an easier way.

–Mitch

I agree. Thanks that worked.

You can also use the built in list() function:

explode = list(rs.ExplodeBlockInstance(block))
1 Like

OK, thanks, good to know - I wasn’t sure that it would work on something like that, recently there was a case where rs.CurveEditPoints() returned a Rhino.Collections.Point3dList instead of just a list of points, and that also works to fix it.

Cheers,
–Mitch

1 Like

Yes, .Net Lists, Arrays, Point3dLists, CurveLists, RhinoList, all instances from Geometry.Collections classes… can be converted to a regular python list (with list() function).

Yeah that works as well. Thanks