Hello,
using the below code, i too was able to view the .nwd file on a .aspx page.(using Navisworks Redistributable Control 10 SDI)
Now i am trying to do a search in the model?But it seems we need a licensed version to execute this code.
i am getting an error "Microsoft JScript runtime error: <<NavisWorks Error - API Unlicensed>>"
So i am planning to test it in a licensed version.
Please share me the code that you have too.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>NavisWork Sample</title>
<script type="text/javascript">
function test(){
alert('called');
var state = ctrlId.state;
var find = state.ObjectFactory(state.GetEnum("eObjectType_nwOpFind"));
var findspec = state.ObjectFactory(state.GetEnum("eObjectType_nwOpFindSpec"));
var findcon = state.ObjectFactory(state.GetEnum("eObjectType_nwOpFindCondition"));
findcon.SetPropertyNames("LcOaNat64AttributeValue");
findcon.SetAttributeNames("LcOpDwgEntityAttrib");
findcon.Condition = state.GetEnum("eFind_EQUAL");
findcon.value = "M/4";
findspec.Selection.SelectAll();
findspec.Conditions().add(findcon);
find.FindSpec = findspec;
var sel = find.FindAll();
state.CurrentSelection = sel;
state.ZoomInCurViewOnCurSel();
}
</script>
</head>
<body>
<input type="button" value="Click Here" onClick="test();">
<div id="canvas" style="position: absolute;top:50px; left: 0px; text-align: center; background-color: #ccc">
<object id="ADViewer" classid="clsid:99D47D37-9B2A-4EBF-8CD9-F16FFB9BF4C5" border="1"
width="1300" height="700" viewastext>
<param name="Src" value="G:\VCP\VC Test 2.nwc">
</object>
</div>
<div id="SectionList" style="position: absolute; top: 100px; left: 425px; width: 175px;
height: 400px; text-align: left; font-size: 10pt; background-color: #ccc">
List of Sections:</br></br>
</div>
</body>
</html>