How to add your knowledge

Embed Autodesk Inventor LT View

    Table of contents
    No headers

    You can embed Autodesk Inventor LT View in any application that supports ActiveX controls, such as Autodesk Buzzsaw, Microsoft Internet Explorer, or Microsoft Word. You can embed the viewer in an HTML file or Web page, and then use the Autodesk Inventor LT View Application Programming Interface (API) properties and methods to design the page. After the Autodesk Inventor LT View application is embedded in another application or file, you have access to most of the Autodesk Inventor LT View features. The context menu and the standard toolbar are both accessed from within the control window.

    The Autodesk Inventor LT View Application Programming Interface (API)

    The Autodesk Inventor LT View Application Programming Interface (API) contains several properties and methods that you can use in your Web page. You can set properties using the <param> tag or you can use the API properties and methods with a scripted language such as Visual Basic Script. You can also create applications with programming languages such as C++ and Visual Basic using the API.

     

    Procedures

    Embed Autodesk Inventor LT View in an HTML file

    You can use the <object> tag to embed Autodesk Inventor LT View and reference a part in an HTML file. You can view a part from the Internet or intranet.

    NoteMicrosoft Internet Explorer version 5.01 or later is required.
    1. Create an HTML file as you normally would.
    2. Set up the controls using the HTML <param> tag. This sets properties that customize the buttons for changing the size of the control window, buttons for changing the display mode, and buttons for opening the file.
      NoteIt is recommended that you use the <param> tag to set properties instead of appending them to the URL or path. There are situations where your browser may remove appended parameters.
    3. Use the "classid" parameter of the <object> tag to embed Autodesk Inventor LT View in the file. The following must be used in your HTML file:

      <object classid="CLSID:A6336AB8-D3E1-489A-8186-EE40F2E027FE" id=ViewerControl1>

    4. Set your API properties for controlling the file in the Web page.

    When setting the height and width parameters in an HTML page, it is recommended that you use static values instead of percentages. If you use percentages, and then resize the browser window, the file is distorted when printed.

    HTML Example

    <HTML>

    <HEAD><TITLE>Test Viewer Control</TITLE></HEAD>

    <BODY>

    <FORM ID="TestForm" LANGUAGE="VBScript">

    <table style-class="BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 border=1><tr><td>

    <blockquote>

    <BOLD>File:</BOLD>

    <input type="file" size="40" NAME="BrowseFile"></td></tr>

    <tr><td align=right><INPUT NAME="OpenButton" TYPE="Button" VALUE="Open"></td></tr>

    <tr><td><INPUT NAME="PerspectiveButton" TYPE="Button" Value ="Perspective">

    <INPUT NAME="LargerButton" TYPE="Button" VALUE="Larger">

    <INPUT NAME="SmallerButton" TYPE="Button" VALUE="Smaller"> <INPUT name="cbInteractive" value ="Interactive" type="CheckBox">Interactive</td></tr>

    <tr><td><INPUT NAME="ShadedButton" TYPE="Radio"> Shaded View

    <INPUT NAME="HiddenButton" TYPE="Radio"> Hidden Line

    <INPUT NAME="WireframeButton" TYPE="Radio"> Wireframe</td></tr></table></blockquote>

    </FORM>

     

    <object classid="CLSID:A6336AB8-D3E1-489A-8186-EE40F2E027FE" id=ViewerControl1 width=400 height=300>

    <param name="_Version" value=65536> <param name="_ExtentX" value=13229>

    <param name="_ExtentY" value=7938> <param name="_StockProps" value=0>

    </object>

     

    <SCRIPT LANGUAGE="VBScript">

     

     

    Sub PerspectiveButton_OnClick()

      Dim TheForm

      Set TheForm = Document.Forms("TestForm")

      If ViewerControl1.Perspective Then

        TheForm.PerspectiveButton.Value = "Orthographic"

        ViewerControl1.Perspective = False

      Else

        TheForm.PerspectiveButton.Value = "Perspective"

        ViewerControl1.Perspective = True

      End If

    End Sub

     

    Sub LargerButton_OnClick()

       ViewerControl1.Width = ViewerControl1.Width * 1.1

       ViewerControl1.Height = ViewerControl1.Height * 1.1

    End Sub

     

    Sub SmallerButton_OnClick()

       ViewerControl1.Width = ViewerControl1.Width * 0.9

       ViewerControl1.Height = ViewerControl1.Height * 0.9

    End Sub

     

    Sub OpenButton_OnClick()

       Dim TheForm

       Set TheForm = Document.Forms("TestForm")

       ViewerControl1.Filename = TheForm.BrowseFile.Value

       TheForm.ShadedButton.checked = true

       TheForm.cbInteractive.checked = true

    End Sub

     

    Sub ShadedButton_OnClick()

       Dim TheForm

       Set TheForm = Document.Forms("TestForm")

       TheForm.HiddenButton.checked = False

       TheForm.WireframeButton.checked = False

       ViewerControl1.DisplayMode = 8708

    End Sub

     

    Sub HiddenButton_OnClick()

       Dim TheForm

       Set TheForm = Document.Forms("TestForm")

       TheForm.ShadedButton.checked = False

       TheForm.WireframeButton.checked = False

       ViewerControl1.DisplayMode = 8707

    End Sub

     

    Sub WireframeButton_OnClick()

       Dim TheForm

       Set TheForm = Document.Forms("TestForm")

       TheForm.ShadedButton.checked = False

       TheForm.HiddenButton.checked = False

       ViewerControl1.DisplayMode = 8706

    End Sub

     

    Sub cbInteractive_OnClick()

       Dim TheForm

       Set TheForm = Document.Forms("TestForm")

       if TheForm.cbInteractive.checked = False then

         ViewerControl1.Interactive = false

       else

         ViewerControl1.Interactive = true

       end if

    End Sub

    </SCRIPT>

    </BODY></HTML>

    Embed Autodesk Inventor LT View in Microsoft applications

    With Microsoft Word, PowerPoint, or Excel you can embed the Autodesk Inventor LT View control and reference a part file inside of a document. You can then distribute the document to others who have installed the Autodesk Inventor LT View control. To do this, create a link to the file name of the part that you want displayed in the document. Make sure that the file resides on a LAN or WWW server that users can access if you plan to distribute the Word, Excel, or PowerPoint file to other users. The alternative is to distribute the file with the document.

    NoteEmbedding Autodesk Inventor LT View is supported in Microsoft Office 2000 or later versions.
    1. Register the InventorViewCtrl.ocx file in a command window if this is the first time you are embedding Autodesk Inventor LT View.

      From the Windows Start menu, select Run. Type "command" or "CMD" in Windows NT, Windows 2000 or Windows XP to start the command window. In the command window, navigate to the following location assuming that Autodesk Inventor LT View is installed in the default location (C:\Program Files [(x86)]\Autodesk\Inventor {release number}\Bin) and type 'regsvr32.exe InventorViewCtrl.ocx', and then press Enter.

    2. Start Microsoft Word, PowerPoint, or Excel.
    3. Select Insert Object. The Object dialog box is displayed.
    4. On the Create New tab, choose Autodesk Inventor LT View Control from the Object Type list, and then click OK.

      A box representing the control is placed in your document and you are automatically in the Design Mode.

    5. Use the grips on the box to position and edit the drawing area. You may need to click outside of the drawing area, and then click back inside the drawing area to activate the sizing grips.
    6. To set the filename that you want to display, right-click inside the viewer control, and then select Properties. Enter the file path into the Filename box.
    7. You can also edit other property boxes to customize your own control.
    8. Click Exit Design Mode in the control toolbar to exit the design mode and display the selected file.

      When you are running the control, you are no longer in the design mode so you cannot change the properties or position of the control in the document.

    9. Move the cursor to the control to display the floating toolbar. Right-clicking in the control window displays the context menu.
    10. To return to design mode, click Design Mode again. If the Design Mode command is not displayed, select View Toolbars Control Toolbox.
    11. Save the document and close the application.

    References

    ActiveViewingCommand property

    Gets and sets the currently active command within the viewer control.

    Access:
     

    In a Microsoft application document, right-click in the viewer control, and then select Properties from the context menu.

    The ActiveViewingCommand property uses the following settings:

    • kViewerZoomAllCommand
    • kViewerZoomWindowCommand
    • kViewerZoomCommand
    • kViewerPanCommand
    • kViewerRotateCommand
    • kViewerNoCommand

    DisplayMode property

    Specifies the display mode of the control window. You can set this property by using the Autodesk Inventor LT View control property sheet or Microsoft Visual Basic.

    Access:
     

    In a Microsoft application document, right-click in the viewer control, and then select Properties from the context menu.

    The DisplayMode property can be set using the drop-down list or by entering one of the number values below. The DisplayMode property uses the following settings:

    8706

    WireframeRendering

    8707

    HiddenEdgeRendering

    8708

    ShadedRendering

    Filename property

    Specifies the file location for the file to open in the control window. You can set this property by using the Autodesk Inventor LT View control property sheet or Microsoft Visual Basic.

    Access:
     

    In a Microsoft application document, right-click in the viewer control, and select Properties from the context menu.

    Type in the location for the file to open in the control window. If you want to open a different file, click in the input box and replace the existing filename with the new one.

    Height property

    Specifies the height of the control window. You can set this property by using the Autodesk Inventor LT View control property sheet or Microsoft Visual Basic.

    Access:
     

    In a Microsoft application document, right-click in the viewer control, and then select Properties from the context menu.

    Enter a numeric value to set the height of the control window. To change the height, click in the input box and enter a new value.

     

    HideToolbar property

    Controls whether the toolbar is displayed when you move the mouse over the view control.

    Access:
     

    In a Microsoft application document, right-click in the viewer control, and then select Properties from the context menu.

    The HideToolbar property uses the following settings:

    True

    Hides the toolbar.

    False

    Displays the toolbar.

    Interactive property

    Indicates whether the interactive mode is turned on for the control window. You can set this property by using the Autodesk Inventor LT View control property sheet or Microsoft Visual Basic.

    Access:
     

    In a Microsoft application document, right-click in the viewer control, and select Properties from the context menu.

    The Interactive property uses the following settings:

    True

    Turns on the interactive mode. With the interactive mode turned on, you can manipulate the graphics view interactively.

    False

    Turns off the interactive mode. If this is selected, the toolbar, context menu, mouse wheel, middle mouse button interactivity, shortcut keys, and hot keys will not be available in the control window. All user input is blocked.

    Name property

    Specifies the name of the object type that the properties are set for. The default name for the first control object is InventorViewControl1. Each consecutive object is named InventorViewControl2, InventorViewControl3, and so on. You can set this property by using the Autodesk Inventor LT View control property sheet or Microsoft Visual Basic.

    Access:
     

    In a Microsoft application document, right-click in the viewer control, and then select Properties from the context menu.

    The InventorViewControl object has several properties that can be set using the control property sheet:

    • ActiveViewingCommand
    • DisplayMode
    • Filename
    • Height
    • HideToolbar
    • Interactive
    • Perspective
    • SheetIndex
    • ViewOrientationType
    • Width

     

    Perspective property

    Sets the camera mode of the control window is to perspective or orthographic. You can set this property by using the Autodesk Inventor LT View control property sheet or Microsoft Visual Basic.

    Access:
     

    In a Microsoft application document, right-click in the viewer control, and select Properties from the context menu.

    The Perspective property uses the following settings:

    True

    Sets the camera mode to perspective view. Part or assembly models are displayed in three-point perspective, a visual effect where parallel lines converge on a vanishing point. This is the way real objects are perceived by the human eye or by a camera.

    False

    Sets the camera mode to orthographic view. The model is displayed so all its points project along parallel lines to their positions on the screen. In this mode, 3D models appear flat and unlike objects observed in the real world.

    SheetIndex property

    Specifies the sheet index of the control window. You can set this property by using the Autodesk Inventor LT View control property sheet orMicrosfot Visual Basic.

    Access:
     

    In a Microsoft application document, right-click in the viewer control, and then select Properties from the context menu.

    Enter a numeric value to set the sheet index of the control window. To change the index number, click in the input box and enter a new value.

    ViewOrientationType property

    Specifies the viewing mode of the control window. You can set this property by using the Autodesk Inventor LT View control property sheet or Microsoft Visual Basic.

    Access:
     

    In a Microsoft application document, right-click in the viewer control, and select Properties from the context menu.

    The ViewOrientationType property can be set using the drop-down list or by entering one of the number values below. The ViewOrientationType property uses the following settings:

    10753

    DefaultViewOrientation

    10754

    TopViewOrientation

    10755

    RightViewOrientation

    10756

    BackViewOrientation

    10757

    BottomViewOrientation

    10758

    LeftViewOrientation

    10759

    IsoTopRightViewOrientation

    10760

    IsoTopLeftViewOrientation

    10761

    BottomRightViewOrientation

    10762

    BottomLeftViewOrientation

    10763

    ArbitraryViewOrientation

    10764

    FrontViewOrientation

    10765

    CurrentViewOrientation

    10766

    SavedCameraViewOrientation

    10767

    FlatPivotRightViewOrientation

    10768

    FlatPivotLeftViewOrientation

    10769

    FlatPivot180ViewOrientation

    10770

    FlatBacksideViewOrientation

    10771

    FlatBacksidePivotRightViewOrientation

    10772

    FlatBacksidePivotLeftViewOrientation

    10773

    FlatBacksidePivot180ViewOrientation

    Width property

    Specifies the width of the control window. You can set this property by using the Autodesk Inventor LT View control property sheet or Microsoft Visual Basic.

    Access:
     

    In a Microsoft application document, right-click in the viewer control, and select Properties from the context menu.

    Enter a numeric value to set the width of the control window. To change the width, click in the input box and enter a new value.