Hi,
I've tried setting properties as described (attaching to a block, then to a blockReference).
No problem in setting and getting, but setted properties seem not to be permanent: if I save, close QCad, and then reopen it, I find no property attached, but only a kind of ",RPropertyAttributes(0x6bbe2f0)" object (in which the fisrt element of couple, containing the val, is null).
It looks like it retains only a pointer to the value object, but non the actual property.
I set property with
- Code: Select all
var operation = new RAddObjectsOperation(false);
var blockEntity = doc.queryBlock("0");
var blockID=blockEntity.getId();
var entityID = doc.queryBlockReferences(blockID);
var entity=doc.queryEntityDirect(entityID[0]);
var di = this.getDocumentInterface();
entity.setProperty(new RPropertyTypeId("Wall Height"), 2.5);
operation.addObject(entity);
di.applyOperation(operation);
I then retrive the property with
- Code: Select all
entity.getProperty(new RPropertyTypeId("Wall Height"));
It works fine, returning the right value, only until I reopen the drawing:then it fails.
I've also tried with entity.setCustomProperty("num", 2.5); and the relative get function, with same behaviour.
I'm testing with QCAD 3.0 trial.
Any suggestion(s)?
Thnk you
Mario