Navisworks API

Navisworks API

Reply
New Member
2 Posts
0 Kudos
Registered: ‎07-13-2012
Post 1 of 5

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

648 Views, 4 Replies
07-13-2012 02:35 AM

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

Member
5 Posts
1 Kudo
Registered: ‎07-24-2012
Post 2 of 5

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

07-24-2012 02:21 AM in reply to: prashanthmallu

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

New Member
2 Posts
0 Kudos
Registered: ‎07-13-2012
Post 3 of 5

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

07-24-2012 11:50 PM in reply to: prashanthmallu

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>

 

Member
5 Posts
1 Kudo
Registered: ‎07-24-2012
Post 4 of 5

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

07-25-2012 12:36 AM in reply to: prashanthmallu

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...

ADN Support Specialist
1,352 Posts
81 Kudos
Registered: ‎06-12-2011
Post 5 of 5

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

08-02-2012 12:40 AM in reply to: johncondron

 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.

 



Xiaodong Liang
Developer Technical Services
Autodesk Developer Network

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!