I have a cylinder(hole in a box) and need around 250,000 copies of the same object, neatly arragned in an array.
I tried to use this macro:
http://sourceforge.net/apps/mediawiki/f ... _ArrayCopy
to copy the object, but FreeCAD always crashes and I think 250000 objects are
simply way to much for this program.
Is there a simpler way to group these objects, since it's a periodic array? I don't want to create 250000 objects by hand ; )
Thanks!
Maximum number of objects? A more elegant way to group them?
Forum rules
and Helpful information
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help
Also, be nice to others! Read the FreeCAD code of conduct!
Also, be nice to others! Read the FreeCAD code of conduct!
-
- Posts: 5
- Joined: Thu Jan 31, 2013 9:07 pm
Re: Maximum number of objects? A more elegant way to group them?
please only use one feature
so instead of assigning the newshape to a new feature, you could fuse all the shapes together.
so instead of assigning the newshape to a new feature, you could fuse all the shapes together.
Code: Select all
oldshape=None
for column in range(u[0]):
for row in range(v[0]):
if (column != 0) or (row != 0):
delta = FreeCAD.Vector(column*u[1],row*v[1],0)
newshape = sel.Shape.copy()
newshape.translate(delta)
if oldshape is not None:
oldshape=oldshape.fuse(newshape)
else:
oldshape=newshape
newobject = FreeCAD.ActiveDocument.addObject("Part::Feature",name)
newobject.Shape = oldshape
-
- Posts: 5
- Joined: Thu Jan 31, 2013 9:07 pm
Re: Maximum number of objects? A more elegant way to group them?
Thanks for your answer! But I'm afraid I'm not a good programmer. I tried to replace the if-else statement in the linked macro by your modified if-else statement.
Could you maybe post the complete macro with the right placement of your modification?
Could you maybe post the complete macro with the right placement of your modification?