Field vdSelectionModified
- Namespace
- vdWebLibrary
- Assembly
- JsPropertiesExtractor.dll
Represents a user define function of type vdSelectionModifiedDelegate that will be called for every user select
public vdSelectionModifiedDelegate vdSelectionModified
Returns
- vdSelectionModifiedDelegate
- Represents a user define function of type that will be called for every user select
Examples
Example 1:For example we allow user to select all of the entities except for lines("vdLine").So every time that copy,rotate,scale,move functions are called,lines can not be selected.
vdcanvas.vdSelectionModified = _vdSelectionModified;//We set the event in the vdrawInitPageLoad()
//Then we create the function which take as parameteres args
function _vdSelectionModified(args) {
//Now we do not allow the user to select lines and we set cancel=true;
if (vdcanvas.Fig_codeToString(args.selectedItem._t) == "vdLine") args.cancel = true;//cancel=true; means that the entity can not be select.
}</code></pre>
Example 2:For example we allow user to select only one line("vdLine").So every time that copy,rotate,scale,move functions are called,only one line can be selected.
vdcanvas.vdSelectionModified = selectionmodified;//We set the event in the vdrawInitPageLoad()
//Then we create the function which take as parameteres eventargs
//and we will finish the selection if at least one vdLine is selected.
function selectionmodified(eventargs) {
//select only one vdLine object
if (vdcanvas.Fig_codeToString(eventargs.selectedItem._t) != "vdLine" || eventargs.action.customData.length > 1)
eventargs.cancel = true;
else if (eventargs.action.customData.length < 1)
eventargs.finish = true;
}