Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to access clipboard objects in the secondary development of TE

Shulou Source: shulou.com Published: 2022-06-01 03:38:40 09月24日 Update

Xiaobian to share with you how to access the clipboard object TE secondary development, I believe most people do not know how to share this article for your reference, I hope you have a lot of harvest after reading this article, let's go to understand it together!

During TE operation and development, when selecting an object in editing state, click the right mouse button to pop up an object operation menu, including cutting, copying, pasting and other functions. You can select an object on the map and carry out general copying and pasting object operations.

In the development, te also provides the corresponding interface, you can through the program development, access the spatial objects in the clipboard, manipulate the objects therein.

The following is an example of js code in te, which briefly explains how to find the contents of the clipboard:

function searchGeometriesClipboard(callbackFunc) {

//does not allow information tree refresh, which has an effect on sketching large quantities of individual objects

SGWorld.ProjectTree.EnableRedraw(0);

var Object;

//Access objects in the clipboard, cycling through them by number

for (i = 0; i < SGWorld.Application.Clipboard.Count; i++) {

try {

//Get a single object

Object = SGWorld.Application.Clipboard.Item(i);

//height type of object

var altitudeType = Object.Position.AltitudeType;

var ret;

if (Object.ObjectType == 1 || Object.ObjectType == 2)

//callbackFunc function, js can pass the function as a parameter to perform some operations

ret = callbackFunc(Object.Geometry, Object.ObjectType, altitudeType, Object.Position);

else

ret = callbackFunc(Object.Position, Object.ObjectType, altitudeType, Object.Position);

if (! ret) {

SGWorld.ProjectTree.EnableRedraw(1);

return;

}

}

catch (e) { }

}

//Allow information tree refresh

SGWorld.ProjectTree.EnableRedraw(1);

}

The above is "TE secondary development in how to access the clipboard object" all the content of this article, thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!

Tags: Object cut development content article information function single selected not much code function example function parameter can be passed map mass most general Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Shulou Tech Info Linux Redmi vpn