hoknamahn Posted May 23, 2006 Share Posted May 23, 2006 I want to add a new operator in this way... Say opadd -n null After that I have to change some properties of that operator. Is it necessarily to have an opname to change it's properties? If so how to get the name? I don't wan to set the operator's name manually. Other problem is the creation of network box by script. Seems that is impossible. Am I right? Quote Link to comment Share on other sites More sharing options...
old school Posted May 23, 2006 Share Posted May 23, 2006 I always use the supplied script uniquename.cmd to set up a variable that builds the object name I want to add, then add it. By predefining the name, you can do subsequent operations to that node easily See the script in $HH/scripts/uniquename.cmd. # Add an operator using uniquename.cmd opcf /obj set opbasename = "model" uniquename.cmd $opbasename "varname" opadd geo $opbasename_$varname opset -d off $opbasename_$varname Quote Link to comment Share on other sites More sharing options...
sibarrick Posted May 23, 2006 Share Posted May 23, 2006 Or you can do something like this set nodename = `execute("opadd -n -v geo geo1")` the -v echos the created name and the variable nodename picks it up, so you can then use $nodename to do whatever else you want with the created node. Quote Link to comment Share on other sites More sharing options...
hoknamahn Posted May 23, 2006 Author Share Posted May 23, 2006 Thanks guys! set nodename = `execute("opadd -n -v null")` did the trick But what about the second question? Any ideas? Quote Link to comment Share on other sites More sharing options...
michael Posted May 23, 2006 Share Posted May 23, 2006 check out: nbadd nbop nbset nbsize nbcolor etc it's really easy... Quote Link to comment Share on other sites More sharing options...
Jason Posted May 23, 2006 Share Posted May 23, 2006 One limitation to keep in mind is that it's quite possible a node to rename itself using their event scripts like "On Created" or "On Input Changed" and currently there is no way to access a node by a unique identifier which remains constant throughout its existence. Recently I had an issue where a certain node renames itself based on who it's wired into so this would fail: set name = `execute("opadd -v mynodetype")` opwire $name -0 someothernode # oops, the node has renamed itself due to its own OnInputChanged script # and I no longer know what it's called. eek! Quote Link to comment Share on other sites More sharing options...
old school Posted May 24, 2006 Share Posted May 24, 2006 Ouch. I see your point. Quote Link to comment Share on other sites More sharing options...
hoknamahn Posted May 24, 2006 Author Share Posted May 24, 2006 Arhhh... opscript is confused me I create a network box and then do opscript and don't see anything about network boxes. So I've decided that HScript can't work with network boxes. I understand that network boxes are not objects but... That behaviour looks strange. Quote Link to comment Share on other sites More sharing options...
Jason Posted May 24, 2006 Share Posted May 24, 2006 Ouch. I see your point. 27923[/snapback] Yeah, it make it impossible to guarantee any result. I believe there is an RFE for this, right? (not mine, someone else mentioned it a while back IIRC). Quote Link to comment Share on other sites More sharing options...
Jason Posted May 24, 2006 Share Posted May 24, 2006 Arhhh... opscript is confused me I create a network box and then do opscript and don't see anything about network boxes. So I've decided that HScript can't work with network boxes. I understand that network boxes are not objects but... That behaviour looks strange. 27929[/snapback] You can't just decide that without changing reality! Arctor is right, all the nb* hscript commands are designed to deal with Network Boxes. Are they not working for you? Quote Link to comment Share on other sites More sharing options...
hoknamahn Posted May 24, 2006 Author Share Posted May 24, 2006 You can't just decide that without changing reality! Arctor is right, all the nb* hscript commands are designed to deal with Network Boxes. Are they not working for you? 27935[/snapback] My eyes... my meagre eyes I checked opscript again and now I see /obj -> opscript -r /obj # Automatically generated script: Wednesday May 24, 18:34 \set noalias = 1 set saved_path = `execute("oppwf")` opcf / # Node obj opcf obj # Network Box netbox1 nbadd netbox1 nblocate -x 1.30588 -y 0.623529 netbox1 nbsize -w 2.5 -h 2.5 netbox1 nbset -m off -p off netbox1 nbcolor -c 0.52 0.52 0.52 netbox1 opcf .. Huh... I must relax frequently Sorry guys for stupid questions Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.