Quantcast
Viewing all articles
Browse latest Browse all 5800

DeleteLinesNested In blocks

@cbecta1 wrote:

Hi people.
I was just trying to batch delete lines that were left inside blocks and nested. Couldn’t do it with a macro, looks like block editor creates kind of a gap in the sequence.
I turned to scripting, found the curves but still, no success in deleting them.
Any ideas?

Here’s my code :

import rhinoscriptsyntax as rs
import pprint as p

print "There are “, rs.BlockCount(), " blocks in this file.”

for blockName in rs.BlockNames(False):
myBlocks = rs.BlockObjects(blockName)
for id in myBlocks:
if rs.IsCurve(id):
print “found a curve:”
print id
crvsList.append(id)
else:
print “not a curve”

crvsList =

for crv in crvsList:
rs.SelectObject(crv)
rs.DeleteObject(crv)

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 5800

Trending Articles