![]() |
|
#1
|
|||
|
|||
|
CustomNode wrapping in python
Hi all,
(I'm using the Vizard 4.0 beta) I'm trying to write a wrapper around a customnode plugin I created following the example in the SDK. I'm new to Python however, and this is proving difficult. I have the wrapper in a separate module, "DNstimuli.py" (this pretty much follows code for a sensor wrapper that I found on the forum): Code:
import viz
class DNStimuli(viz.VizCustomChild):
def testCall(self):
self.command(1, 'TX')
viz.upgradeCustomNode('customnode',DNStimuli)
def addDNStimuli():
return viz.add('customnode.dlc')
Code:
import viz from DNstimuli import addDNStimuli viz.go() custom = addDNStimuli() custom.testCall() Code:
Traceback (most recent call last):
File "<string>", line 11, in <module>
File "C:\dat\C\projects\Vizard dll\quicktest.py", line 7, in <module>
custom.testCall()
AttributeError: 'VizCustomChild' object has no attribute 'testCall'
Thank you for the advice and help in getting me started with this part of the job! Best, Dee |
|
#2
|
|||
|
|||
|
Ok, it turns out I had to use
viz.upgradeCustomNode('customnode.dlc',DNStimuli) instead of viz.upgradeCustomNode('customnode',DNStimuli) Didn't think of trying that as the other thread specifically said to take off the extension maybe that was old info) |
![]() |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ERROR: Failed to initialize python | kay | Vizard | 1 | 10-07-2009 12:51 PM |
| Vizard tech tip: Using the Python Imaging Library (PIL) | Jeff | Vizard | 0 | 03-23-2009 12:13 PM |
| IE cannot display form response page from python server | Gladsomebeast | Vizard | 2 | 12-01-2008 10:12 PM |
| python 2.4 instead of 2.3? | perselletje | Vizard | 7 | 03-14-2006 12:06 PM |
| Extending Python With C++ | Vygreif | Vizard | 2 | 01-18-2006 10:21 AM |