Index of /acrobat3d/setview

      Name                    Last modified      Size  Description
Parent Directory - axes.u3d 04-Nov-2009 12:51 7.0K blank.gif 04-Nov-2009 12:50 47 script.js 04-Nov-2009 12:50 376 setview.pdf 04-Nov-2009 17:46 7.6K

This example shows how to read the URL for the pdf and take the query string portion (i.e. the part after the "?" hash symbol) and set the current view.

Try the following urls:
setview.pdf?view=Left
setview.pdf?view=Top
setview.pdf?view=Front
setview.pdf?view=Isometric
Here's the script attached to the 3D annotation:
if ( host && host.external )
{
	var url = host.util.crackURL( host.URL );

	if ( url.cQuery )
	{
		var vars = parseQuery( url.cQuery );
		if ( vars.view )
		{
			var animate = false;
			runtime.setView( vars.view, animate );
		}
	}
}

function parseQuery( query )
{
	var result = {};
	var pairs = query.split( "&" );
	for ( var i = 0; i < pairs.length; i++ )
	{
		var pair = pairs[ i ].split( "=" );
		if ( pair[ 0 ] && pair[ 1 ] )
			result[ pair[ 0 ] ] = pair[ 1 ];
	}
	return result;
}