Help writing to property in custom template feature

Sat 6. May 2017, 01:05

I'm working on a plugin and need a bit of help writing to a template property.
I am able to enumerate the GetAvailableProperties() method and see my items, but I can't seem to find where/how to write to them.
Any advice?

Thanks,
JohnRossitter
 
Posts: 5
Joined: Tue 2. May 2017, 19:57

Re: Help writing to property in custom template feature

Mon 8. May 2017, 11:21

Hi John,

Reading and writing to properties can both be done by using the indexer of the ObjectProxy object.
Only some special cases or often used properties have an own getter/setter method.

If you look at the list from GetAvailableProperties() you will find two types of names:

If the name contains a dot '.' the property comes from a feature and has the form
Code: Select all
<feature-technical name>.<property-technical name>

if there is no dot in the name it is a "class" property of the object itself.

if you need to write to a specific template property just assign a value
Code: Select all
obj["myfeaturename.mypropertyname"] = value


For handling elements of a strip the read indexer give you a IList<ObjectProxy> you can use to inspect.
Changing elements such a list must be done with the Add/Remove/Insert Attachment To/From Strip methods (e.g. AddAttachmentIntoStrip( propertyname, obj )
User avatar
[Articy] Peter Sabath
Articy Staff
Articy Staff
 
Posts: 89
Joined: Wed 23. Nov 2011, 13:58
Location: Bochum

Re: Help writing to property in custom template feature

Mon 8. May 2017, 17:19

Awesome
Will give it a shot tonight
JohnRossitter
 
Posts: 5
Joined: Tue 2. May 2017, 19:57

Return to articy:draft Macro Devkit

Who is online

Users browsing this forum: No registered users and 2 guests

Who We Are
Contact Us
Social Links