1
Automation Interface, Add-Ins and Tools / Re: Adding Tags via Javascript
« on: January 25, 2018, 01:40:04 am »
I think that is what happened:
I initialize it like this:
Thanks to all the answers. I was not aware the getTreeSelectedObject was this dangerous.
I initialize it like this:
Code: [Select]
rootElement= Repository.GetTreeSelectedObject();
DumpElements("", rootElement);
and it seems this sometimes does not work and I get null. After checking if the tags exist it runs through:Code: [Select]
if(tags!=null){
newTag = tags.AddNew(taggedValueName, taggedValueValue);
}
Thanks to all the answers. I was not aware the getTreeSelectedObject was this dangerous.