  | | | Basic scripting question.. | Basic scripting question.. 2005-04-15 - By kim aldis
Back
__ __
From: owner-xsi@(protected) [mailto:owner-xsi@(protected)] On Behalf Of Bradley R. Gabe Sent: 14 April 2005 22:47 To: XSI@(protected); XSI@(protected) Subject: Re: Basic scripting question..
Also, check out the AddNull() method. It creates a new null as the child of the object that calls it [kim aldis] that was the point I probably didn't make clear in my earlier response, that the second arg to GetPrim() is what you use to name the null and the 3rd is an object you want to parent the new null to, if you do go down this root. The other thing I'd done was to use the return value to GetPrim( "Null" ) to get the newly created object which would be faster and shorter code than using the selection object. As Brad points out, you can use the AddNull() method. This is way quicker partly because you have the added advantage that it doesn't register in the history because it's a method, not a command:- set oRoot = ActiveProject.ActiveScene.Root
set oNullRoot = oRoot.AddNull( "TheRootOfAllEvil" ) for i = 0 to 20 set oNullRoot.AddNull( "Money" ) next
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=us-ascii"> <META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD> <BODY> <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2></FONT> </DIV><BR> <BLOCKQUOTE dir=ltr style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px"> <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left> <HR tabIndex=-1> <FONT face=Tahoma size=2><B>From:</B> owner-xsi@(protected) [mailto:owner-xsi@(protected)] <B>On Behalf Of </B>Bradley R. Gabe<BR><B>Sent:</B> 14 April 2005 22:47<BR><B>To:</B> XSI@(protected); XSI@(protected)<BR><B>Subject:</B> Re: Basic scripting question..<BR></FONT><BR></DIV> <DIV></DIV> <DIV> Also, check out the AddNull() method. It creates a new null as the child of the object that calls it<BR><SPAN class=093283106-15042005><FONT face =Arial color=#0000ff size=2>[kim aldis] </FONT></SPAN></DIV> <DIV><SPAN class=093283106-15042005><FONT face=Arial color=#0000ff size=2 >that was the point I probably didn't make clear in my earlier response, that the second arg to GetPrim() is what you use to name the null and the 3rd is an object you want to parent the new null to, if you do go down this root.</FONT></SPAN></DIV> <DIV><SPAN class=093283106-15042005></SPAN> </DIV> <DIV><SPAN class=093283106-15042005><FONT face=Arial color=#0000ff size=2>The other thing I'd done was to use the </FONT> <FONT face=Arial color=#0000ff size=2>return value to GetPrim( "Null" ) to get the newly created object which would be faster and shorter code than using the selection object.</FONT></SPAN></DIV> <DIV><SPAN class=093283106-15042005><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><SPAN class=093283106-15042005><FONT face=Arial color=#0000ff size=2>As Brad points out, you can use the AddNull() method. This is way quicker partly because you have the added advantage that it doesn't register in the history because it's a method, not a command:-</FONT></SPAN></DIV> <DIV><SPAN class=093283106-15042005><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><SPAN class=093283106-15042005><!--StartFragment --> <PRE class =pPreformatted>set oRoot = ActiveProject.ActiveScene.Root<A name=wp567256> </A> set oNullRoot = oRoot.AddNull( "TheRootOfAllEvil" )</PRE><PRE class =pPreformatted>for i = 0 to 20</PRE><PRE class=pPreformatted> set oNullRoot.AddNull( "Money" )</PRE><PRE class=pPreformatted>next</PRE></SPAN ></DIV></BLOCKQUOTE></BODY></HTML>
|
|
 |