One of our Project Freewheel software developers, Yuanfei Xu, is working on the collaboration solution software API. Here is what he has suggested. This is a work in progress.
API Name: loadPath
Description: Load the DWF file into freewheel object
Arguments: zUrl (URL String of DWF file. Only support HTTP/FTP format…)
Return: Null
Example:var fw = new AdskLabs.Freewheel.Mashup(parentDivObj); fw.loadPath("http://freewheel.labs.autodesk.com/sample/CompositeSuspension.dwf");
API Name: getPath
Description: Get the path of current DWF file
Arguments: Null
Return: String (path of current DWF file)
Example:var fw = new AdskLabs.Freewheel.Mashup(parentDivObj); document.getElementById("show").value = fw.getPath();
API Name: setSection
Description: Set the section of current DWF file in freewheel object
Arguments: index (the index of the section)
Return: Null
Example:var fw = new Adsk.Freewheel.Mashup(parentDivObj); fw.setSection( 2 );
API Name: getSection
Description: Get the current section of current DWF file
Arguments: Null
Return: index( index of current section)
Example:var fw = new Adsk.Freewheel.Mashup(parentDivObj); document.getElementById("show").value = fw.getSection();
API Name: getSectionType
Description: Get the current section Type (2D/3D) of current DWF file
Arguments: Null
Return: Return the value that indicate whether this section is 2D or 3DAdskLabs.Freewheel.SectionType = { MODLE2D: 1, MODLE3D: 2 };
Example:var fw = new Adsk.Freewheel.Mashup(parentDivObj); if( fw.getSection() == AdskLabs.Freewheel.SectionType.MODLE2D ){ setTransparent( picture ); }
API Name: setCamera
Description: Set the camera information for DWF section
Arguments: String
Return: Null
Example:var fw = new Adsk.Freewheel.Mashup(parentDivObj); fw.setCamera( "sec=1&scale=1&cx=0.5&cy=0.5" );
API Name: getCamera
Description: Get the camera of current DWF file
Arguments: Null
Return: String
Example:var fw = new Adsk.Freewheel.Mashup(parentDivObj); document.getElementById("show").value = fw.getCamera();
API Name: showButton
Description: Show the buttons
Arguments: Define an enumeration type.AdskLabs.Freewheel.Button = { Pan: 1 << 0, Zoom: 1 << 1, Orbit: 1 << 2, Wheel: 1 << 3, };
Return: Null
Example:var fw = new Adsk.Freewheel.Mashup(parentDivObj); fw.showButton(AdskLabs.Freewheel.Button.Pan | AdskLabs.Freewheel.Button.Zoom );
API Name: hideButton
Description: Hide the buttons
Arguments: Define an enumeration type.AdskLabs.Freewheel.Button = { Pan: 1 << 0, Zoom: 1 << 1, Orbit:1 << 2, Wheel:1 << 3 };
We will use that to pass into the function
Return: Null
Example:var fw = new Adsk.Freewheel.Mashup(parentDivObj); fw.hideButton(AdskLabs.Freewheel.Button.Pan | AdskLabs.Freewheel.Button.Zoom );
API Name: showToolBar
Description: Show the toolbars
Arguments: Define an enumeration typeAdskLabs.Freewheel.Toolbar = { Nav: 1 << 0 };
We will use that to pass arguments into the function
Return: Null
Example:var fw = new Adsk.Freewheel.Mashup(parentDivObj); fw.showToolBar(AdskLabs.Freewheel.Button.Nav );
API Name: hideToolBar
Description: Hide the toolbars
Arguments: Define an enumeration typeAdskLabs.Freewheel.Toolbar = { Nav:1 << 0 };
We will use that to pass arguments into the function
Return: Null
Example:var fw = new Adsk.Freewheel.Mashup(parentDivObj); fw.hideToolBar(AdskLabs.Freewheel.Button.Nav );
API Name: setCurrentTool
Description: Set the default operation model for the freewheel object. For example, user want to pan the freewheel by default
Arguments: Define an enumeration typeAdskLabs.Freewheel.ActionTool = { ZOOM: 1, PAN: 2, ORBIT: 3 };
Return: Null
Example:var fw = new Adsk.Freewheel.Mashup(parentDivObj); fw.setCurrentTool(AdskLabs.Freewheel.ActionTool.PAN );
API Name: registerEvent
Description: When we operate the Freewheel object we want to give the 3rd party a chance to know something changed, and do something for that
Arguments: Define an enumeration typeAdskLabs.Freewheel.EventType = { PathChange: 1, SectionChange:2, CameraChange: 3 };
Example :var onPathChange = function( str ){ document("_dwfPath").value = str; } var fw = new Adsk.Freewheel.Mashup(parentDivObj); fw.registerEvent( AdskLabs.Freewheel.EventType.PathChange, onPathChange);
If you have suggestions on what you would like to see, please email us at [email protected].
Getting feedback on how applications work with design data using software as service is alive in the lab.