Viewpoint Developer Central    Viewpoint Forums    Viewpoint Forums  Hop To Forum Categories  VETScript    MTSBaseComponent.RemoveObject
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
rik
Member
Posted
Hi

Here is the my problem:

I have an instance into the scene.
I want to remove it and after ,via loadMTXStr, change some xml node and put it again into the scene.

I've tried this:

MTSBaseComponent.RemoveObject( "myInstanceName" );

loadMTXStr( '<MTSInstance Name="myInstanceName">........</MTSInstance>' );

But it seems to execute removeObject after loadMTXStr

can you help me to resolve the question?
 
Posts: 34 | Registered: March 17, 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of Admin
Posted Hide Post
Hi Rik,

I would place the calls to both these actions in an animator to make absolutely sure one gets called before the other. Let me know if you need more info.
 
Posts: 1188 | Registered: January 08, 2003Reply With QuoteEdit or Delete MessageReport This Post
rik
Member
Posted Hide Post
Hi,

I solved the problem using:

function draw(){

loadMTXStr( ...... );

}


setTimeout("draw()",500);


but I'm not sure that is a right way

( is a litle strange )

maybe RemoveObject function is an independent task.
 
Posts: 34 | Registered: March 17, 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of Admin
Posted Hide Post
Sounds like a bug, are you using the RemoveObject VETDispatch xml call? You should probably try to do this in an action in the mtx, one after the other.
 
Posts: 1188 | Registered: January 08, 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of duncan
Posted Hide Post
I will try to look into this... perhaps we can add an event to handle when remove object is done so you don't have to set a timer. In the meantime, perhaps you're timer should instead loop and check to see if the removed object node is null or undefined before loading the new node.
 
Posts: 381 | Registered: January 24, 2003Reply With QuoteEdit or Delete MessageReport This Post
rik
Member
Posted Hide Post
Hi
I've strange result with:

MTSBaseComponent.RemoveObjectAndDependencies( myInstance);
MTSBaseComponent.RemoveObject( myInstance);

and

<MTSAction Name="deleteInstance" Type="Script" >
<VETDispatchCall Function="MTSBaseComponent::RemoveObjectAndDependencies( myInstance)"/>
</MTSAction>


I want to delete different instances at the same time using more calls to the RemoveObjectAndDependencies function

So I wait 1 second to redraw updated instances but sometime, in a random way, some instances is drawed and others not

Frown

thanks a lot for your help
 
Posts: 34 | Registered: March 17, 2003Reply With QuoteEdit or Delete MessageReport This Post
  Powered by Eve Community  
 

Viewpoint Developer Central    Viewpoint Forums    Viewpoint Forums  Hop To Forum Categories  VETScript    MTSBaseComponent.RemoveObject