Viewpoint Developer Central    Viewpoint Forums    Viewpoint Forums  Hop To Forum Categories  JavaScript    Solidworks Explode/Collapse Script

Moderators: e_phoenix13
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Junior Member
Posted
I need help with a Solidworks file that used to have an explode/collapse javascript function, that does not work anymore. I lost the functionality when updating the page to MTS3Interface.js. You can see the page at:

http://www.sgmgroup.com/solidworks4.html

thanks
 
Posts: 4 | Registered: December 01, 2006Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of Admin
Posted Hide Post
Hello,

This is because you are using the old triggeranimation() call. This does not work with MTS3Interface.js. You can find out about all the accessible MTS3Interface javascript functions on pages 161 and 162 of the Viewpoint Rich Media Authoring Guide available here.
 
Posts: 1188 | Registered: January 08, 2003Reply With QuoteEdit or Delete MessageReport This Post
Junior Member
Posted Hide Post
That was helpful, but I still need more help. I found the script for ToggleCollapse, which I guess must replace the separate Explode and Collapse functions. Pasted that code into line 88 of my code. See this link:

http://www.sgmgroup.com/solidworks5.html

Now how do I trigger the function? I tried to modify some code I found on page 165 of the guide, but that failed.
 
Posts: 4 | Registered: December 01, 2006Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of Admin
Posted Hide Post
Here, this should work:

vmp.TriggerAnim('ExplodeSteps');

vmp.TriggerAnim('UnExplodeSteps');
 
Posts: 1188 | Registered: January 08, 2003Reply With QuoteEdit or Delete MessageReport This Post
Junior Member
Posted Hide Post
That seems to have done it. If I want to add more of these functions is there somewhere to find the instructions like you just sent? I searched the guide and couldn't find 'ExplodeSteps'.

Regardless thanks for the quick help.
 
Posts: 4 | Registered: December 01, 2006Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of Admin
Posted Hide Post
'ExplodeSteps' and 'UnExplodeSteps' are the names you gave your animations in the mtx file, not VET properties. I found them by downloading your mtx file and looking at it. Smile
 
Posts: 1188 | Registered: January 08, 2003Reply With QuoteEdit or Delete MessageReport This Post
Junior Member
Posted Hide Post
Since I don't have Solidworks here. Is there something else that could view the file contents?
 
Posts: 4 | Registered: December 01, 2006Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of Admin
Posted Hide Post
You can view mtx files in any text editor. Even notepad.

Regards
 
Posts: 1188 | Registered: January 08, 2003Reply With QuoteEdit or Delete MessageReport This Post
  Powered by Eve Community  
 

Viewpoint Developer Central    Viewpoint Forums    Viewpoint Forums  Hop To Forum Categories  JavaScript    Solidworks Explode/Collapse Script