API(응용프로그램 프로그래밍 인터페이스)에는 웹 페이지에서 사용할 수 있는 여러 특성과 메서드가 포함되어 있습니다.
<param> 태그를 사용하여 특성을 설정하거나 Visual Basic Script 같은 스크립트 언어와 함께 API 특성과 메서드를 사용할 수 있습니다. API를 사용하는 C++ 및 Visual Basic 같은 프로그래밍 언어를 사용하여 응용프로그램을 작성할 수도 있습니다.
<object> 태그를 사용하여 HTML 파일에 Inventor View를 포함하고 해당 파일에서 부품을 참조할 수 있습니다. 인터넷이나 인트라넷에서 부품을 볼 수 있습니다.
<object classid="CLSID:A6336AB8-D3E1-489A-8186-EE40F2E027FE" id=ViewerControl1>
HTML 페이지에서 높이와 폭 매개변수를 설정할 때에는 백분율 대신 정적 값을 사용하는 것이 좋습니다. 백분율을 사용하여 검색기 창의 크기를 조정하면 인쇄 시 파일이 왜곡됩니다.
<HTML>
<HEAD><TITLE>뷰어 컨트롤 테스트</TITLE></HEAD>
<BODY>
<FORM ID="TestForm" LANGUAGE="VBScript">
<table style-class="BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 border=1><tr><td>
<blockquote>
<BOLD>파일:</BOLD>
<input type="file" size="40" NAME="BrowseFile"></td></tr>
<tr><td align=right><INPUT NAME="OpenButton" TYPE="Button" VALUE="열기"></td></tr>
<tr><td><INPUT NAME="PerspectiveButton" TYPE="Button" Value ="원근">
<INPUT NAME="LargerButton" TYPE="Button" VALUE="더 큼">
<INPUT NAME="SmallerButton" TYPE="Button" VALUE="더 작음"> <INPUT name="cbInteractive" value ="Interactive" type="CheckBox">대화식</td></tr>
<tr><td><INPUT NAME="ShadedButton" TYPE="Radio"> 음영처리된 뷰
<INPUT NAME="HiddenButton" TYPE="Radio"> 은선
<INPUT NAME="WireframeButton" TYPE="Radio"> 와이어프레임</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 = "직교"
ViewerControl1.Perspective = False
Else
TheForm.PerspectiveButton.Value = "원근"
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>