Method copy
- Namespace
- vdWebLibrary
- Assembly
- JsPropertiesExtractor.dll
copy(object, object, ScriptSelectDelegate)
Copy the passed entities from a point in worldcs to an other in worldcs. It also write to UndoHistory() and script buffer Check the function finished throw the passed callback delegate
public void copy(object fromPoint, object toPoint, ScriptSelectDelegate callback)
Parameters
fromPointobjectA point in world CS or undefined for user prompt
toPointobjectA point in world CS or undefined for user prompt
callbackScriptSelectDelegateA ScriptSelectDelegate user defined function that will be called when the command finish
Examples
//1. prompt the user for selection
vdrawObj.scriptCommand.select(null,function (_vdcanvas) { _vdcanvas.scriptCommand.copy(); } );
//2. No user prompt do this action for all active layout entities
var entities = [];
var layout = vdcanvas.GetActiveLayout();
for (var i = 0; i < layout.Entities.Items.length; i++) {
var h = layout.Entities.Items[i];
fig = vdrawObj.GetEntityItem(h);
entities.push(fig);
}
vdrawObj.scriptCommand.select(entities,function (_vdcanvas) { _vdcanvas.scriptCommand.copy([0,0,0],[10,10,0]); } );//copy from 0,0 to 10,10