Anchoring wndws in walls the VBA way

Anchoring wndws in walls the VBA way

Anonymous
Not applicable
255 Views
4 Replies
Message 1 of 5

Anchoring wndws in walls the VBA way

Anonymous
Not applicable
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?
0 Likes
256 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Peter,

 

I modified a couple of lines and made some
desicions on anchor positions.  In the ADT Customization NG, Peter Funk's
post of 1/19/01, VBA Homework 300 - Solved, he describes how to insert a door
into a wall.  It would be similar for windows.

 

 

Chris

 

Sub InsWndw()
 Dim cc As
Variant
 Dim WinObj As AecWindow
 '''''''''''''''''''Dim ancWall
As New AecAnchorWinAssemblyToWall
 Dim ancWall As New
AecAnchorEntToWall
 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
 ancWall.Reference = oWall
 ancWall.XPositionFrom =
aecCurvePositionEnd
 ancWall.XPositionTo =
aecEdgePositionEnd
 ancWall.XDistance = -3 'your
choice
 ancWall.AttachEntity WinObj

 

End Sub
0 Likes
Message 3 of 5

Anonymous
Not applicable
Thanks for the help!
Are the ADT customization posts with VBA Home*ork still available?
0 Likes
Message 4 of 5

Anonymous
Not applicable
I have asked but I have never been able to get the
early posts.

 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Thanks
for the help!
Are the ADT customization posts with VBA Home*ork still
available?
0 Likes
Message 5 of 5

Anonymous
Not applicable
Chris and all -

At http://discussion.autodesk.com/ you can search the newsgroups
for previously posted questions. Put keywords in the blank box
and then chose search for "last 3 days, last 2 weeks, last 3
months or all". Search will bring up a list of newsgroup messages
matching the text you provide in the search box.

For the search engine limited to the ADT groups, go to
http://discussion.autodesk.com/WebX?14@@.ee93828. By using the
Autodesk server search engine you will be searching all available
messages not just those on your local message cache.

Put in the words VBA Homework as the search words and chose All
for the time length of the search. 43 topics come up. The one
titled "VBA Homework 300" is the tenth topic. Clicking on an
individual topic listed in the search findings will spread out
the messages in that topic in a tree formation.The topics are
listed by date with the newest date at the top.

Hope this helps you in future questions.
--
Anne Brown
Manager, Moderator
Autodesk Product Support discussion groups

Chris Picklesimer wrote:
>
> I have asked but I have never been able to get the early posts.
0 Likes