Page 1 of 1

Removing an image entity

Posted: Tue May 13, 2014 8:51 am
by s4eed
Hello dear friends.
I add an image entity to my map using this code :

Code: Select all

	var i = new RImageEntity(
		document,
			 new RImageData("scripts/MyScripts/tick.png",
							new RVector(0,0),
							new RVector(1,0),
							new RVector(0,1),
							50, 50, 0)
	);
	documentInterface.setRelativeZero(point);
	i.setWidth(2);
	i.setHeight(2);

	i.setInsertionPoint(point);
	TickImageEntites[entId] = i;
Suppose that entId is a unique key associated to each ImageEntity and TickImageEntites is something like this :

Code: Select all

var TickImageEntites = {};
Then I want to remove all of this image entities inside TickImageEntites using this code :

Code: Select all

		for (var k in TickImageEntites) {
			QMessageBox.information(0,"msg", "id:"+k);
			var op = new RDeleteObjectOperation(TickImageEntites[k], false);
                        di.applyOperation(op);
		}

But my code doesn't work at all! What the problem. thanks.

Re: Removing an image entity

Posted: Tue May 13, 2014 11:18 pm
by andrew
You might want to print TickImageEntites[k] in your for loop, to check if these are valid entities with a valid ID, etc.