Community
Navisworks API
Welcome to Autodesk’s Navisworks API Forums. Share your knowledge, ask questions, and explore popular Navisworks API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Is there a way to display the Naviswork viewer control in a web browser(ASP.NET)

4 REPLIES 4
Reply
Message 1 of 5
prashanthmallu
1580 Views, 4 Replies

Is there a way to display the Naviswork viewer control in a web browser(ASP.NET)

We have the navisworks viewer control working in windows application.

 

Is there a way to display the navisworks viewer in a web browser(ASP.NET), I mean in a .aspx page

 

if possible please post me a sample piece of code.

 

Prasanth.k

4 REPLIES 4
Message 2 of 5

Hi prashanthmallu,

 

I've managed to get the control working in an ASP.Net page, but I'm having some problem getting the controls for selecting other .nwd files etc working... 

 

I just asked a question about it and posted a link to some blog posts by Xiaodong Liang http://forums.autodesk.com/t5/Autodesk-Navisworks-API/Navisworks-ActiveX-Control/td-p/3549588

 

Hope that helps you.

 

Cheers....

 

John

Message 3 of 5

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>

 

Message 4 of 5

My code is pretty much the same as yours. 

 

I think that there are only limited functions you can do with the Redistributable API and a license is required for using the Integrated API.  That's certainly how it appears to me, but like I said before, last week I had no idea what Navisworks was so I can't be certain.

 

Have you saw this thread discussing the licensed API? http://forums.autodesk.com/t5/Autodesk-Navisworks-API/Use-Naviswork-ActiveX-with-Licensed-API/td-p/3...

Message 5 of 5

 johncondron  is correct.  As the blog says: the functionalities of Redistributable control are very limited. You will need to use Integrated control to have the full abilities.

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report