please take a look on my simple script, and tell/direct me what do I miss.
When I place block manualy, all ok. All Block Attributs on place.
But script not add Block Attributes ("Dependent Entities"). Only Block itself.
How add Block Childes and change there values before op.addObject(blockEntity); ?
Code: Select all
di.setCurrentLayer("myLayer");
var op = new RAddObjectsOperation();
var blockId = document.getBlockId("blockName");
var position = new RVector(x,y);
var scale = new RVector(1,1);
var angle = RMath.deg2rad(0);
var columnCount = 1;
var rowCount = 1;
var columnSpacing = 0;
var rowSpacing = 0;
var blockEntity = new RBlockReferenceEntity(document, new RBlockReferenceData (
blockId,
position,
scale,
angle,
columnCount,
rowCount,
columnSpacing,
rowSpacing
));
op.addObject(blockEntity, false)
di.applyOperation(op);