Glad you were able to solve the problems and it sounds like it's working now like it should...
You're right that i haven't attempted to handle the modeler code in the ConstructionKit just because there's too many possibilities to account for.
I have been doing something like the following for modeler plugins though (see here: https://github.com/j053ph4/ZenPacks.community.zenJavaApp/blob/master/ZenPacks/community/zenJavaApp/modeler/plugins/JavaAppMap.py)
Basically I'm importing the Definition.py within the plugin, and then inside the plugin class, doing :
constr = Construct(Definition) | |
compname = "os" | |
relname = constr.relname | |
modname = constr.zenpackComponentModule | |
baseid = constr.baseid |
then using the "baseid" as part of the component id:
name = "%s_%s" % (self.baseid,str(port)) | |
info['id'] = prepId(name) |
Unfortunately, though, I haven't thought of a way to automatically map the component attributes to modeler plugin output, so the modeler code references the component attributes directly.
I've also added another possible property to the Definition.py that determines whether or not the "manual add" GUI code gets activated (for modeler-created only components):
addManual = False |
Hope this helps,
Joseph