Help needed for solving strange errors in my stepwise-addon

Because I do not know how to replace a here uploaded zip-file I give a link where to find it
http://pkhg.nl/blender/voordbc.zip

OK install it by unzipping it to …/2.70/scripts/addons and you should get there a directory stepwise2PKHG
after activating (search for stepwise or find it under Mesh in the addon tab) the addon
You should find a tab in the tools menu (below) DefineInfo use only ModelPresets , the LanguagePresets do yet nothing.

PLEASE work now as follows:
activate via the ModelPresets s_castle … Now a button to activate will be available in the PROPERTIES part of the Blender window! Click please the Data part, where at the bottom you can find the Activation button. Click it please.
Now step throug using stepsize 1 only …
It will generate a castle … OK , this works always (behalve of strange message convertViewVec … question about this in other thread)
Via the ModelPresets you can remove the model (use s_mesh_delete , activate and do one step)

Now activate again s_castle but set the stepsize to 4 and step. It works again!

Remove the model and activate s_castle again set the stepsize to 20 or so and try it.

NOW I GET THE NOT UNDERSTOOD ERROR
PKHG>DBG ========
[]
Traceback (most recent call last):
File “D:\BlendeFoundation\Blender\2.70\scripts\addons\stepwise2PKHG\pkhg_test_gui.py”, line 289, in execute
exec(st);
File “<string>”, line 1, in <module>
File “D:\BlendeFoundation\Blender\2.70\scripts\addons\stepwise2PKHG\s_castle.py”, line 222, in step17
bpy.context.active_object.modifiers[‘Solidify’].thickness = 0.25
KeyError: ‘bpy_prop_collection[key]: key “Solidify” not found’

WHY is the Solidify-modifier not created???

AND a second problem with s_castle.py is not understood too
If trying to (new Blender loaded) do let it do all steps at once I stops too (the solidify is NOW well meanwhile done!!!???)
step20 make a border
convertViewVec: called in an invalid context
step21 make point roof and colors
convertViewVec: called in an invalid context
CTX_data_pointer_get_type: warning, member ‘object’ is ‘ID’, not ‘Object’
CTX_data_pointer_get_type: warning, member ‘object’ is ‘ID’, not ‘Object’
CTX_data_pointer_get_type: warning, member ‘object’ is ‘ID’, not ‘Object’
Traceback (most recent call last):
File “D:\BlendeFoundation\Blender\2.70\scripts\addons\stepwise2PKHG\pkhg_test_gui.py”, line 289, in execute
exec(st);
File “<string>”, line 1, in <module>
File “D:\BlendeFoundation\Blender\2.70\scripts\addons\stepwise2PKHG\s_castle.py”, line 278, in step21
bpy.ops.object.vertex_group_add()
File “D:\BlendeFoundation\Blender\2.70\scripts\modules\bpy\ops.py”, line 188, in call
ret = op_call(self.idname_py(), None, kw)
RuntimeError: Operator bpy.ops.object.vertex_group_add.poll() failed, context is incorrect

WHO understands this behavior of my addon and who as maybe an advice to solve these problems?

Greets
Peter

Thanks Atom for having looked at my addon …

I have to confess, that I understand your reply only ‘half’ ;-( …

In principle, I would like to use bpy.* things and python-commands gotten from Blender-Python itself …

So it looks like I have to understand e.g. faking the context …

Stepwise at least, Gus and Castle can be created with the addon …