? [solved] Add custom property in library item script
Posted: Fri May 16, 2014 9:35 am
Hello,
I wrote a library item script for inserting drawings of steel sections in several sizes according to DIN standard. Now I want to add a custom property to the (polyline) entity using the .setProperty() method like it's shown here https://ribbonsoft.com/rsforum/viewtopic.php?p=4552.
But when I add this code (line 89/90 in attached file "StructuralSteelSectionsI.js")
there's nothing shown in the property editor and I get the following error message:
I printed the content of variable "des" with "qdebug(des)" and it showed the right value. Changing the color using
worked, so I guess the variable "polylineEntity" is also a correct Entity object. What did I miss?
Best regards
Stephan
Edit:
I'm using QCAD version 3.5.1.0 on Linux Mint Debian (32bit)
I wrote a library item script for inserting drawings of steel sections in several sizes according to DIN standard. Now I want to add a custom property to the (polyline) entity using the .setProperty() method like it's shown here https://ribbonsoft.com/rsforum/viewtopic.php?p=4552.
But when I add this code (line 89/90 in attached file "StructuralSteelSectionsI.js")
Code: Select all
var des = "DIN 1025-1" + " - " + "I " + StructuralSteelSectionsI.hi ;
polylineEntity.setProperty(new RPropertyTypeId("designation"), des);
Code: Select all
Warning: RObject::setProperty: cannot set custom property with empty title or name
Code: Select all
polylineEntity.setColor(new RColor("blue"));
Best regards
Stephan
Edit:
I'm using QCAD version 3.5.1.0 on Linux Mint Debian (32bit)