Code: Select all
doc = App.ActiveDocument
obj = doc.getObject('Cut001')
box = doc.getObject('Group')
v = doc.addObject('App::Link')
v.setLink(box)
vv = doc.addObject('App::Link')
vv.setLink(v)
vv.ShowElement=False
count = 0
pList = []
if True: # Just to make below run in python console in 1 go
for xx in range (0,10):
for yy in range(0,10):
for zz in range(0,16):
xl = xx*1000
yl = yy*1000
zl = zz*1000
v = None
if obj.Shape.isInside(App.Vector(xl,yl,zl),0,True): # if point lies on a face it's considered inside
count = count + 1
pList.append(App.Placement(App.Vector(xl,yl,zl),App.Rotation(App.Vector(0,0,1),0)))
print(count)
vv.ElementCount = count
vv.PlacementList = pList