Using an in-place activation control requires that you set a single property. The Src property is a string that stores the path and name, or the URL, of the file displayed by AutoCAD.
An in-place activation control also exports a single method that is called either explicitly or implicitly, depending on the host context. The PostCommand method sends a string from Display.exe to the command line of AutoCAD.
In the following two procedures, you use the control from the previous procedure in a Visual Basic application and in an HTML web page.
The AutoCAD in-place activation control is displayed in the Toolbox.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.Exception) Handles MyBase.Load AxAcCtrl1.Src = "C:\colorwh.dwg" End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.Exception) Handles Button1.Click AxAcCtrl1.Focus() AxAcCtrl1.PostCommand ("line") End Sub
Make sure that you pass a command string that is supported by your product.
You can include a space, if appropriate, as if you were using a command in AutoCAD. For example, enter Line 1,1 10,10, and include a space after the second 10. Or enter the command Zoom 10x, and include a space after 10x.
The in-place activation control should display the file you specified in step 8
The command you passed in should affect the file in Display.exe's child window.
<OBJECT id="Acad" classid="clsid:12490290-02E9-4B5E-BE0A-38E27EB98150" width=400 height=300> <PARAM NAME="src" VALUE="http://Your_Server_Name/Your_Path/colorwh.dwg"> </OBJECT>
The in-place activation control should display the file whose URL you specified in the VALUE attribute in step 4.