Method ExplodeObjects
- Namespace
- vdWebLibrary
- Assembly
- JsPropertiesExtractor.dll
ExplodeObjects(object)
Note supported exploded objects are vdInsert, vdRect , vdPolyline(with lines and bulges) , vd3dFace, vdPolyface and entities with Explode collection property like dimensions or vdProxyFigures.
Note also that the ExplodeObjects does not support External Reference blocks.
Returns an array of the exploded entities of the passed entities collection.
See also explode()
public object ExplodeObjects(object entities)
Parameters
entitiesobjectThe collection of objects that it will be exploded.
Returns
Examples
In the example bellow we start a new selection and let the user select some objects get the exploded entities and add them to the active layout
NOTE after ExplodeObjects operation the return entities are not exist in the layout and also are not be drawn on the screen. We use the RegisterFigure method which add them in the entities of the layout and also give them a new handle. Finally mark the original selected objects as deleted
vdcanvas.scriptCommand.select(null, _myselectCallback);
function _myselectCallback(vdcanvas) {
var selectedEntities = vdcanvas.scriptCommand.ActiveSelection();//get the selection to be exploded from the user
var objs = vdcanvas.ExplodeObjects(selectedEntities);
for (var k = 0; k < objs.length; k++) {
var entity = objs[k];
vdcanvas.scriptCommand.RegisterFigure(entity, true, true);//register all the entities of the block to active the layout
}
vdcanvas.scriptCommand.erase(selectedEntities);
setTimeout(vdcanvas.redraw);
}