6 Replies Latest reply on Nov 13, 2013 11:05 AM by Earl Hasz

    Can't get view to load in HTML

    John Burrill

      Hi everyone.  I'm new to 3DVia composer and one of the uses my boss wants me to explore is publishing our annotated models to HTML for incorporation into our company web site. 

      After a lot of experimentation and trial and error with the viewer, I can finaly get the smgXML to open in internet explorer, but the viewer either shows the background only or the default view settings and I'm trying to get it to load a specific view.  I'm using the Simple HTML template.

      From the programming guide, I've noticed that there are two ways that I could get player to switch to a particular view.  I can either set the "StartupView" parameter (which requires the Professional version of the player) or I can call the "gotoView" method.

      I've tried both but haven't been able to get either one to work correctly.  I don't get an error or anything when I load the HTML, it just reverts to displaying the empty view background.

      I put the startupview property at the bottom of the list of parameters and called it like this:

      <param name="Startupview" value="View 7"/>

      For the Gotoview method, I tried adding a script right before the closing html tag after the other script calls like this

      <script>document._3dviacomposeractivex.gotoview("View 7")</script>


      I've attached a zip of my exported web page.  You have to go into file properties on the zip file and unblock it before extracting the files, otherwise the programs won't run.

      If anyone can give me some advice about getting this working, I'd appreciate it.

      Oh the files were published from 3DVia Composer 2013x (6.11.2254)



        • Re: Can't get view to load in HTML
          Earl Hasz

          In your top level HTML file, have a go with this section near the bottom of the file.  I added the underlined code during the EndLoadModel event.  This starts the scene with "View 7".





          <!--  init template -->


          <script event="EndLoadModel" for="_3DVIAPlayerActiveX" type="text/javascript">
















              document._3DVIAPlayerActiveX.GoToView("View 7");



            • Re: Can't get view to load in HTML
              John Burrill

              That is just wicked excellent, Earl.  thanks

              Obviously part of my problem is my lack of familiarity with java script.  Can you tell me, how is the statement interpreted by the compiler if it doesn't have the semi-colon at the end and are the commands case-sensetive?


                • Re: Can't get view to load in HTML
                  Earl Hasz

                  The commands are not case sensitive in Javascript.  I do this out of correctness and Javascript's brother, C#, is case sensitive.


                  The ';' is interpreted as the end of that statement.  In VB, the end of line is the end of the statement.  You could write a whole series of commands on one line by simply separating them by semi-colons.

              • Re: Can't get view to load in HTML
                Silas Curfman

                I know this is an older post and already answered, but I have a related question. 


                Is the behavior the OP saw, the opening of the browser to either a blank background or a default view, exactly how it is supposed to open or is this behavior an error.  I've been struggling with the same thing this week myself.  I've contacted my VAR, normally very helpful, and they struggled with a solution as well.  The only thing that helped was the java scrip line shown in the solution above.  Is it not fair to assume that an .html ouput of a Composer project should initially open to the same first view as the project has?


                I guess what I'm asking is... "Should I consider the solution above a bandaid for erroneous behavior or standard procedure?"  Thanks.