PDA

View Full Version : Why do i get Script error: Object Required



priyankag
2008-09-17, 06:33 AM
I am new to Navis.I am working on Loading a NavisWorks file i.e NWD File in a Activex Control specified in <Object> which will be displayed in the browser. It works fine as an individual HTML Page. But If I embed the Same code in Web Application, It gives script error "Object Required 'NWControl01'" where 'NWControl01' is object Tag ID and also the other navigation functionality of the 3model except the default one like Walk or even the Views does not work. I have written the below given code in my aspx page which is the same as given in one of the examples given by Manage 2009

<object id="NWControl01" classid="CLSID:A168C4D5-286C-47b2-9FB0-4E0A2C16CCA7" codebase="~\Bin\Navis.cab">
<param name="_cx" value="14000" />
<param name="_cy" value="12000" />
<param name="SRC" value="C:\TokmoNavis\gatehouse.nwd" />
</object>

<script language="VBScript" type="text/vbscript">

<!--

public sub btnView_Clicked(cmd_ndx)

with NWControl01.state

.ApplyView .SavedViews(cmd_ndx)

end with

end sub



public sub btnViewAll_Clicked()

NWControl01.state.ViewAll
NWControl01.state.HiddenItemsResetAll

end sub



public sub btnNav_Clicked(nmd_ndx)

NWControl01.state.CurrentView.ViewPoint.Paradigm = (nmd_ndx)

end sub

public sub btnLinkOn_Clicked()

NWControl01.state.URLsEnabled = TRUE

end sub

public sub btnLinkOff_Clicked()

NWControl01.state.URLsEnabled = FALSE

end sub

public sub btnLightOff_Clicked()

NWControl01.state.CurrentView.ViewPoint.Lighting = 0

end sub

public sub btnLightOn_Clicked()

NWControl01.state.CurrentView.ViewPoint.Lighting = 3

end sub


-->
</script>