Jump to content
Developer Wiki and Function Reference Links ×

Dropdown List for Symbols?


willofmaine

Recommended Posts

 

 

@Marionette.NodeDefinition
class Params(metaclass = Marionette.OrderedClass):
	
	def get_SymDefs_in_File ():
		'''
			Returns all Symbol-Definitions as list found in the active Document.
		'''
		
		syms = []	
		
		SYMBOL_DEFINI_TYPE = 16	
		 
		CURRENT_DOC = 0 
		Res_List, NumItems = vs.BuildResourceList (SYMBOL_DEFINI_TYPE, CURRENT_DOC, '')
		
		for i in range (NumItems):
			# Die Resourcelist beginnt nicht wie üblich mit dem Index 0 sondern mit 1 
			i += 1
			
			h = vs.GetResourceFromList (Res_List, i)		   
			
			syms.append ( vs.GetName(h))
		
		return syms
	###

	this = Marionette.Node( 'Get Sym' )
	
	sym_list = get_SymDefs_in_File ()
	
	sym_popUp = Marionette.OIPControl( 'Syms', Marionette.WidgetType.Popup, 0, sym_list)
	
	sym = Marionette.PortOut()   
	
	
def RunNode(self):
	sel_idx = self.Params.sym_popUp.value
	self.Params.sym.value = self.Params.sym_popUp.popupChoices[sel_idx]

 

Unfortunately you have to run it to refresh the popup values.

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...