Get the current view

Get the current view

Anonymous
Not applicable
482 Views
9 Replies
Message 1 of 10

Get the current view

Anonymous
Not applicable
Can some one tell me how to get the current view (i.e.
Top,Bottom,Left,Right,Front,Back)

Andy
0 Likes
483 Views
9 Replies
Replies (9)
Message 2 of 10

Anonymous
Not applicable
do you mean in model space, what direction you're looking from? or are you
talking about some paperspace viewports? is it vanilla autocad you're
working in, or one of the vertical products?

Kevin

"Andrew Elmore" wrote in message
news:E3266AC8D01EABE8C55AB664D697917E@in.WebX.maYIadrTaRb...
> Can some one tell me how to get the current view (i.e.
> Top,Bottom,Left,Right,Front,Back)
>
> Andy
>
>
0 Likes
Message 3 of 10

Anonymous
Not applicable
When in modelspace and/or paperspace. if I change the current view to say
front then have have a message box promt the current view that I'm looking
from. If I can get that then I can figure the rest of the code out. (I'm
going to have layers frozen and unfrozen depending on the current view)

I'm useing ADT 2004. for this program.

Thanks,
Andy

"Kevin Terry" wrote in message
news:204F1DFD122530ADC8D79695F6B9E4D0@in.WebX.maYIadrTaRb...
> do you mean in model space, what direction you're looking from? or are you
> talking about some paperspace viewports? is it vanilla autocad you're
> working in, or one of the vertical products?
>
> Kevin
>
> "Andrew Elmore" wrote in message
> news:E3266AC8D01EABE8C55AB664D697917E@in.WebX.maYIadrTaRb...
> > Can some one tell me how to get the current view (i.e.
> > Top,Bottom,Left,Right,Front,Back)
> >
> > Andy
> >
> >
>
>
0 Likes
Message 4 of 10

Anonymous
Not applicable
Don't know if this will be of any help to you, but check out the sample
installed on your computer called example_events.DVB (C:\Program
Files\MDT6\Sample\VBA\example_events.DVB on mine).

Kevin

"Andrew Elmore" wrote in message
news:83AF7B14E59F09B1C25A18CE77DB8E59@in.WebX.maYIadrTaRb...
> When in modelspace and/or paperspace. if I change the current view to say
> front then have have a message box promt the current view that I'm looking
> from. If I can get that then I can figure the rest of the code out. (I'm
> going to have layers frozen and unfrozen depending on the current view)
>
> I'm useing ADT 2004. for this program.
>
> Thanks,
> Andy
>
> "Kevin Terry" wrote in message
> news:204F1DFD122530ADC8D79695F6B9E4D0@in.WebX.maYIadrTaRb...
> > do you mean in model space, what direction you're looking from? or are
you
> > talking about some paperspace viewports? is it vanilla autocad you're
> > working in, or one of the vertical products?
> >
> > Kevin
> >
> > "Andrew Elmore" wrote in message
> > news:E3266AC8D01EABE8C55AB664D697917E@in.WebX.maYIadrTaRb...
> > > Can some one tell me how to get the current view (i.e.
> > > Top,Bottom,Left,Right,Front,Back)
> > >
> > > Andy
> > >
> > >
> >
> >
>
>
0 Likes
Message 5 of 10

Anonymous
Not applicable
I don't Have that one on my computer could you post it please.

Andy


"Kevin Terry" wrote in message
news:A5F1E3BE91F6AC50BF2A7D18E8DA5334@in.WebX.maYIadrTaRb...
> Don't know if this will be of any help to you, but check out the sample
> installed on your computer called example_events.DVB (C:\Program
> Files\MDT6\Sample\VBA\example_events.DVB on mine).
>
> Kevin
>
> "Andrew Elmore" wrote in message
> news:83AF7B14E59F09B1C25A18CE77DB8E59@in.WebX.maYIadrTaRb...
> > When in modelspace and/or paperspace. if I change the current view to
say
> > front then have have a message box promt the current view that I'm
looking
> > from. If I can get that then I can figure the rest of the code out. (I'm
> > going to have layers frozen and unfrozen depending on the current view)
> >
> > I'm useing ADT 2004. for this program.
> >
> > Thanks,
> > Andy
> >
> > "Kevin Terry" wrote in message
> > news:204F1DFD122530ADC8D79695F6B9E4D0@in.WebX.maYIadrTaRb...
> > > do you mean in model space, what direction you're looking from? or are
> you
> > > talking about some paperspace viewports? is it vanilla autocad you're
> > > working in, or one of the vertical products?
> > >
> > > Kevin
> > >
> > > "Andrew Elmore" wrote in message
> > > news:E3266AC8D01EABE8C55AB664D697917E@in.WebX.maYIadrTaRb...
> > > > Can some one tell me how to get the current view (i.e.
> > > > Top,Bottom,Left,Right,Front,Back)
> > > >
> > > > Andy
> > > >
> > > >
> > >
> > >
> >
> >
>
>
0 Likes
Message 6 of 10

Anonymous
Not applicable
do a search on your hard drive or installation cd - it's provided with your
standard licensed copy of whatever autocad product you have.

Kevin

"Andrew Elmore" wrote in message
news:524B4125851A94D71B8BDA23A81FA535@in.WebX.maYIadrTaRb...
> I don't Have that one on my computer could you post it please.
>
> Andy
>
>
> "Kevin Terry" wrote in message
> news:A5F1E3BE91F6AC50BF2A7D18E8DA5334@in.WebX.maYIadrTaRb...
> > Don't know if this will be of any help to you, but check out the sample
> > installed on your computer called example_events.DVB (C:\Program
> > Files\MDT6\Sample\VBA\example_events.DVB on mine).
> >
> > Kevin
> >
> > "Andrew Elmore" wrote in message
> > news:83AF7B14E59F09B1C25A18CE77DB8E59@in.WebX.maYIadrTaRb...
> > > When in modelspace and/or paperspace. if I change the current view to
> say
> > > front then have have a message box promt the current view that I'm
> looking
> > > from. If I can get that then I can figure the rest of the code out.
(I'm
> > > going to have layers frozen and unfrozen depending on the current
view)
> > >
> > > I'm useing ADT 2004. for this program.
> > >
> > > Thanks,
> > > Andy
> > >
> > > "Kevin Terry" wrote in message
> > > news:204F1DFD122530ADC8D79695F6B9E4D0@in.WebX.maYIadrTaRb...
> > > > do you mean in model space, what direction you're looking from? or
are
> > you
> > > > talking about some paperspace viewports? is it vanilla autocad
you're
> > > > working in, or one of the vertical products?
> > > >
> > > > Kevin
> > > >
> > > > "Andrew Elmore" wrote in message
> > > > news:E3266AC8D01EABE8C55AB664D697917E@in.WebX.maYIadrTaRb...
> > > > > Can some one tell me how to get the current view (i.e.
> > > > > Top,Bottom,Left,Right,Front,Back)
> > > > >
> > > > > Andy
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
0 Likes
Message 7 of 10

Anonymous
Not applicable
I searched the hard drive ADT,ACAD and no file close to example_Events

Andy

"Kevin Terry" wrote in message
news:54BAD627AB2644108D51C70DBBBF30C1@in.WebX.maYIadrTaRb...
> do a search on your hard drive or installation cd - it's provided with
your
> standard licensed copy of whatever autocad product you have.
>
> Kevin
>
> "Andrew Elmore" wrote in message
> news:524B4125851A94D71B8BDA23A81FA535@in.WebX.maYIadrTaRb...
> > I don't Have that one on my computer could you post it please.
> >
> > Andy
> >
> >
> > "Kevin Terry" wrote in message
> > news:A5F1E3BE91F6AC50BF2A7D18E8DA5334@in.WebX.maYIadrTaRb...
> > > Don't know if this will be of any help to you, but check out the
sample
> > > installed on your computer called example_events.DVB (C:\Program
> > > Files\MDT6\Sample\VBA\example_events.DVB on mine).
> > >
> > > Kevin
> > >
> > > "Andrew Elmore" wrote in message
> > > news:83AF7B14E59F09B1C25A18CE77DB8E59@in.WebX.maYIadrTaRb...
> > > > When in modelspace and/or paperspace. if I change the current view
to
> > say
> > > > front then have have a message box promt the current view that I'm
> > looking
> > > > from. If I can get that then I can figure the rest of the code out.
> (I'm
> > > > going to have layers frozen and unfrozen depending on the current
> view)
> > > >
> > > > I'm useing ADT 2004. for this program.
> > > >
> > > > Thanks,
> > > > Andy
> > > >
> > > > "Kevin Terry" wrote in message
> > > > news:204F1DFD122530ADC8D79695F6B9E4D0@in.WebX.maYIadrTaRb...
> > > > > do you mean in model space, what direction you're looking from? or
> are
> > > you
> > > > > talking about some paperspace viewports? is it vanilla autocad
> you're
> > > > > working in, or one of the vertical products?
> > > > >
> > > > > Kevin
> > > > >
> > > > > "Andrew Elmore" wrote in message
> > > > > news:E3266AC8D01EABE8C55AB664D697917E@in.WebX.maYIadrTaRb...
> > > > > > Can some one tell me how to get the current view (i.e.
> > > > > > Top,Bottom,Left,Right,Front,Back)
> > > > > >
> > > > > > Andy
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
0 Likes
Message 8 of 10

Anonymous
Not applicable
Can get the VBA to get the command -View; but I can't get what the user
selected top,bot,sw, ect...

anybody know how to get this.

Andy

"Kevin Terry" wrote in message
news:54BAD627AB2644108D51C70DBBBF30C1@in.WebX.maYIadrTaRb...
> do a search on your hard drive or installation cd - it's provided with
your
> standard licensed copy of whatever autocad product you have.
>
> Kevin
>
> "Andrew Elmore" wrote in message
> news:524B4125851A94D71B8BDA23A81FA535@in.WebX.maYIadrTaRb...
> > I don't Have that one on my computer could you post it please.
> >
> > Andy
> >
> >
> > "Kevin Terry" wrote in message
> > news:A5F1E3BE91F6AC50BF2A7D18E8DA5334@in.WebX.maYIadrTaRb...
> > > Don't know if this will be of any help to you, but check out the
sample
> > > installed on your computer called example_events.DVB (C:\Program
> > > Files\MDT6\Sample\VBA\example_events.DVB on mine).
> > >
> > > Kevin
> > >
> > > "Andrew Elmore" wrote in message
> > > news:83AF7B14E59F09B1C25A18CE77DB8E59@in.WebX.maYIadrTaRb...
> > > > When in modelspace and/or paperspace. if I change the current view
to
> > say
> > > > front then have have a message box promt the current view that I'm
> > looking
> > > > from. If I can get that then I can figure the rest of the code out.
> (I'm
> > > > going to have layers frozen and unfrozen depending on the current
> view)
> > > >
> > > > I'm useing ADT 2004. for this program.
> > > >
> > > > Thanks,
> > > > Andy
> > > >
> > > > "Kevin Terry" wrote in message
> > > > news:204F1DFD122530ADC8D79695F6B9E4D0@in.WebX.maYIadrTaRb...
> > > > > do you mean in model space, what direction you're looking from? or
> are
> > > you
> > > > > talking about some paperspace viewports? is it vanilla autocad
> you're
> > > > > working in, or one of the vertical products?
> > > > >
> > > > > Kevin
> > > > >
> > > > > "Andrew Elmore" wrote in message
> > > > > news:E3266AC8D01EABE8C55AB664D697917E@in.WebX.maYIadrTaRb...
> > > > > > Can some one tell me how to get the current view (i.e.
> > > > > > Top,Bottom,Left,Right,Front,Back)
> > > > > >
> > > > > > Andy
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
0 Likes
Message 9 of 10

Anonymous
Not applicable
You could do something brute-force like the following. Set the views
yourself and check the variable manually to populate your If...Then (If you
want the function to work when someone chooses their view relative to the
UCS, you'd need to add another flag to the sub). The 'eq' function is just
to get past the computer's exactness. This is a non-working example.
Good luck,
James

Function WhichViewActive() as string
dim varViewDir as variant
varViewDir = getVariable("VIEWDIR")
Dim varVD_WCS As Variant 'view direction vector, translated from UCS to
WCS
varVD_WCS = ThisDrawing.Utility.TranslateCoordinates(varVD, acUCS,
acWorld, True)

vX = varVD_WCS (0)
vY = varVD_WCS (1)
vZ = varVD_WCS (2)
if EQ(vX,0,0.01) and EQ(vY,0,0.01) and EQ(vZ,-1,0.01) then
WhichViewActive = "TOP"
elseif EQ(vX,0,0.01) and ...
WhichViewActive = ...
else
WhichViewActive = "UNKNOWN"
endif
End Function
Public Function eq(val1 As Double, val2 As Double, fuzz As Double) As
Boolean
'function courtesy of www.acadx.com
eq = Abs(val1 - val2) <= fuzz
End Function
0 Likes
Message 10 of 10

Anonymous
Not applicable
Thanks James
"James Belshan" wrote in message
news:DFEEFA41815B377438AEE2E356B49072@in.WebX.maYIadrTaRb...
> You could do something brute-force like the following. Set the views
> yourself and check the variable manually to populate your If...Then (If
you
> want the function to work when someone chooses their view relative to the
> UCS, you'd need to add another flag to the sub). The 'eq' function is
just
> to get past the computer's exactness. This is a non-working example.
> Good luck,
> James
>
> Function WhichViewActive() as string
> dim varViewDir as variant
> varViewDir = getVariable("VIEWDIR")
> Dim varVD_WCS As Variant 'view direction vector, translated from UCS
to
> WCS
> varVD_WCS = ThisDrawing.Utility.TranslateCoordinates(varVD, acUCS,
> acWorld, True)
>
> vX = varVD_WCS (0)
> vY = varVD_WCS (1)
> vZ = varVD_WCS (2)
> if EQ(vX,0,0.01) and EQ(vY,0,0.01) and EQ(vZ,-1,0.01) then
> WhichViewActive = "TOP"
> elseif EQ(vX,0,0.01) and ...
> WhichViewActive = ...
> else
> WhichViewActive = "UNKNOWN"
> endif
> End Function
> Public Function eq(val1 As Double, val2 As Double, fuzz As Double) As
> Boolean
> 'function courtesy of www.acadx.com
> eq = Abs(val1 - val2) <= fuzz
> End Function
>
>
0 Likes