Window swing direction

Window swing direction

Anonymous
Not applicable
855 Views
9 Replies
Message 1 of 10

Window swing direction

Anonymous
Not applicable
Is there a way to determine the swing direction of a window?

Jussi
0 Likes
856 Views
9 Replies
Replies (9)
Message 2 of 10

Anonymous
Not applicable
Add a property set to the doorstyle with the automatic property Swing Direction.

You can then use it in tags and schedules.
0 Likes
Message 3 of 10

Anonymous
Not applicable
Yes, but what about windows?

Windows have swing directions, but they don't have automatic properties for
them.
I was wondering if there was some other way to determine it, through APIs?

Jussi

kirjoitti viestissä:5002439@discussion.autodesk.com...
Add a property set to the doorstyle with the automatic property Swing
Direction.

You can then use it in tags and schedules.
0 Likes
Message 4 of 10

Anonymous
Not applicable
You can get at it through the API, but it is easiest to just use a VBScript formula property set definition.

The definition will depend if you have 2006 and want xref ability.

For ADT2004 define a property set for windows with an automatic property of "Handle".
Then define a formula property named "Swing" and use the following for it's definition. Be sure to use the UI to pick "Handle" so that it appears in bold, cutting and pasting references to other properties does not work.

**** Start 2004 Script
On Error Resume Next
RESULT="--"

Set app = GetObject(,"AutoCAD.Application.16")
set window = app.ActiveDocument.HandleToObject([Handle])
set anchor = window.GetAnchor
if anchor.FlipX then
RESULT = "LEFT"
else
RESULT = "RIGHT"
end if
***** end 2004 script

For 2006 and Xref usage, define a property set for doors. Add the automatic property "ObjectID" and add a formula property called "Swing" with the following definition.

****** Start 2006 script
On Error Resume Next
RESULT="--"

Set app = GetObject(,"AutoCAD.Application.16.2")
set window = app.ActiveDocument.HandleToObject([ObjectID])
set anchor = window.GetAnchor
if anchor.FlipX then
RESULT = "LEFT"
else
RESULT = "RIGHT"
end if
****** end 2006 script

If you need me to post a drawing instead, just let me know.

Chris Arps
0 Likes
Message 5 of 10

Anonymous
Not applicable
Excellent!
Thanks!

Jussi

kirjoitti viestissä:5005567@discussion.autodesk.com...
You can get at it through the API, but it is easiest to just use a VBScript
formula property set definition.

The definition will depend if you have 2006 and want xref ability.

For ADT2004 define a property set for windows with an automatic property of
"Handle".
Then define a formula property named "Swing" and use the following for it's
definition. Be sure to use the UI to pick "Handle" so that it appears in
bold, cutting and pasting references to other properties does not work.

**** Start 2004 Script
On Error Resume Next
RESULT="--"

Set app = GetObject(,"AutoCAD.Application.16")
set window = app.ActiveDocument.HandleToObject([Handle])
set anchor = window.GetAnchor
if anchor.FlipX then
RESULT = "LEFT"
else
RESULT = "RIGHT"
end if
***** end 2004 script

For 2006 and Xref usage, define a property set for doors. Add the automatic
property "ObjectID" and add a formula property called "Swing" with the
following definition.

****** Start 2006 script
On Error Resume Next
RESULT="--"

Set app = GetObject(,"AutoCAD.Application.16.2")
set window = app.ActiveDocument.HandleToObject([ObjectID])
set anchor = window.GetAnchor
if anchor.FlipX then
RESULT = "LEFT"
else
RESULT = "RIGHT"
end if
****** end 2006 script

If you need me to post a drawing instead, just let me know.

Chris Arps
0 Likes
Message 6 of 10

Anonymous
Not applicable
I just noticed an error with the 2006 script, the correct line for using ObjectID/xrefs is

set window = app.ActiveDocument.ObjectIdToObject([ObjectID])

Chris Arps
0 Likes
Message 7 of 10

Anonymous
Not applicable
btw, make that
if anchor.FlipX Xor anchor.FlipY then

thanks again,
Jussi

kirjoitti viestissä:5008034@discussion.autodesk.com...
I just noticed an error with the 2006 script, the correct line for using
ObjectID/xrefs is

set window = app.ActiveDocument.ObjectIdToObject([ObjectID])

Chris Arps
0 Likes
Message 8 of 10

Anonymous
Not applicable
I can't get this to work. It only shows LEFT, and when i flip the window, nothing changes. Anyone know what's wrong?

This is what my code looks like:

On Error Resume Next
RESULT="--"
Set app = GetObject(,"AutoCAD.Application.16.2")
set window = app.ActiveDocument.HandleToObject([ObjectID])
set anchor = window.GetAnchor
if anchor.FlipY or anchor.FlipX then
RESULT = "V"
else
RESULT = "H"
end if

I use ADT 2006 if that is any help

Thanks,

Christopher
0 Likes
Message 9 of 10

Anonymous
Not applicable
Note Chris' correction in his Nov/09/05 reply:

I just noticed an error with the 2006 script, the correct line for using ObjectID/xrefs is

set window = app.ActiveDocument.ObjectIdToObject([ObjectID])

--

David Koch
Autodesk Discussion Group Facilitator
Using ADT 2004 at work; access to 2005, 2006 & 2007 at home
0 Likes
Message 10 of 10

Anonymous
Not applicable
This does not seem to work either, I'm afraid.
Any other ideas?

Thanks,
Christopher
0 Likes