TheSwamp
Code Red => .NET => Topic started by: itcad on June 04, 2009, 11:46:30 PM
-
How to use "AutoCAD Dockable Container" in C#?
reference: http://www.jrl-e.com/index.htm
Who can tell me?
Below is an example of a VB implemented IRetrieveDockableContainer:
‘ Global variable so the interface can be used at a later time if needed.
Dim dockContainer As AcadDockableContainer
Implements IRetrieveDockableContainer
Private Sub IRetrieveDockableContainer_SetDockContainer(ByVal newVal As IAcadDockableContainer)
‘ Keep this interface around by assigning it to a global variable.
Set dockContainer = newVal
‘ Allow docking only on the left and right sides of AutoCAD
dockContainer.EnableDockPositions = acDockLeft + acDockRight
‘ We want the window to appear as a floating window the very first time.
‘ The size of the floating window is specified below.
Dim rect(0 To 3) As Integer
rect(0) = 50 ' left
rect(1) = 50 ' top
rect(2) = 300 ' right
rect(3) = 300 ' bottom
dockContainer.SetPreferredDockPosition acFloating, rect
End Sub
How to write these in c#?
-
Well, variable declarations go from this form
Dim dockContainer As AcadDockableContainer
to this form
AcadDockableContainer dockContainer;
and the array declaration would look like this
int[] rect = {50, 50, 300, 300};
and the other translation issues are just as minor. This leads me to believe that your question is deeper than a simple translation issue. And not to take anything away from Jorge's hard work, but couldn't you just use a palette?
How to use "AutoCAD Dockable Container" in C#?
reference: http://www.jrl-e.com/index.htm
Who can tell me?
Below is an example of a VB implemented IRetrieveDockableContainer:
‘ Global variable so the interface can be used at a later time if needed.
Dim dockContainer As AcadDockableContainer
Implements IRetrieveDockableContainer
Private Sub IRetrieveDockableContainer_SetDockContainer(ByVal newVal As IAcadDockableContainer)
‘ Keep this interface around by assigning it to a global variable.
Set dockContainer = newVal
‘ Allow docking only on the left and right sides of AutoCAD
dockContainer.EnableDockPositions = acDockLeft + acDockRight
‘ We want the window to appear as a floating window the very first time.
‘ The size of the floating window is specified below.
Dim rect(0 To 3) As Integer
rect(0) = 50 ' left
rect(1) = 50 ' top
rect(2) = 300 ' right
rect(3) = 300 ' bottom
dockContainer.SetPreferredDockPosition acFloating, rect
End Sub
How to write these in c#?