Message 1 of 5
Anchoring wndws in walls the VBA way

Not applicable
06-19-2002
03:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Within ADT I want to automatically add a window using VBA.
I know that I first must define the window, then anchor it to
a selected wall. My problem is anchoring it, I can't seem to figure it out.
Here is the code snippit I am using.
Sub InsWndw()
Dim cc As Variant
Dim WinObj As AecWindow
Dim ancWall As New AecAnchorWinAssemblyToWall
Dim oWall As AecWall
ThisDrawing.Utility.GetEntity oWall, cc, "select wall:"
ancWall.Reference = oWall
Set WinObj = _
ThisDrawing.ModelSpace.AddCustomObject("AecWindow")
WinObj.StyleName = "Casement"
WinObj.OpenPercent = 50
WinObj.AttachObject ancWall
End Sub
Reviewing from the examples in ADT help this should work.
Any help here?
I know that I first must define the window, then anchor it to
a selected wall. My problem is anchoring it, I can't seem to figure it out.
Here is the code snippit I am using.
Sub InsWndw()
Dim cc As Variant
Dim WinObj As AecWindow
Dim ancWall As New AecAnchorWinAssemblyToWall
Dim oWall As AecWall
ThisDrawing.Utility.GetEntity oWall, cc, "select wall:"
ancWall.Reference = oWall
Set WinObj = _
ThisDrawing.ModelSpace.AddCustomObject("AecWindow")
WinObj.StyleName = "Casement"
WinObj.OpenPercent = 50
WinObj.AttachObject ancWall
End Sub
Reviewing from the examples in ADT help this should work.
Any help here?