WorldViz User Forum  

Go Back   WorldViz User Forum > Plug-in development

Thread Tools Rate Thread Display Modes
Old 02-13-2011, 09:45 PM
dcnieho dcnieho is offline
Join Date: Feb 2011
Posts: 59
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, "" (this pretty much follows code for a sensor wrapper that I found on the forum):
import viz

class DNStimuli(viz.VizCustomChild):
	def testCall(self):
		self.command(1, 'TX')

def addDNStimuli():
	return viz.add('customnode.dlc')
I then use it as follows:
import viz
from DNstimuli import addDNStimuli


custom = addDNStimuli()
This errors with:
Traceback (most recent call last):
  File "<string>", line 11, in <module>
  File "C:\dat\C\projects\Vizard dll\", line 7, in <module>
AttributeError: 'VizCustomChild' object has no attribute 'testCall'
What am I doing wrong / how do I do this cleanly? I want to keep my syntax simple and short in the main script, from what I think I've learned about Python, I therefore need to import the specific components from the module or I'll have to prefix everything by the module name.

Thank you for the advice and help in getting me started with this part of the job!

Reply With Quote
Old 02-13-2011, 10:28 PM
dcnieho dcnieho is offline
Join Date: Feb 2011
Posts: 59
Ok, it turns out I had to use
instead of

Didn't think of trying that as the other thread specifically said to take off the extension maybe that was old info)
Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ERROR: Failed to initialize python kay Vizard 1 10-07-2009 11:51 AM
Vizard tech tip: Using the Python Imaging Library (PIL) Jeff Vizard 0 03-23-2009 11:13 AM
IE cannot display form response page from python server Gladsomebeast Vizard 2 12-01-2008 09:12 PM
python 2.4 instead of 2.3? perselletje Vizard 7 03-14-2006 11:06 AM
Extending Python With C++ Vygreif Vizard 2 01-18-2006 09:21 AM

All times are GMT -7. The time now is 11:22 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Copyright 2002-2018 WorldViz LLC