Hello Everyone!
Does anyone know the VBA line of code that will change an isometric view in model space to a top view??
I have searched and have come up empty?
Thanks,
Rob
Hello Everyone!
Does anyone know the VBA line of code that will change an isometric view in model space to a top view??
I have searched and have come up empty?
Thanks,
Rob
Hi Rob
Try to use SenCommand method
I think easiest one
[vba]
Sub top()
ThisDrawing.SendCommand "-VIEW _TOP " '<--blank space after TOP
End Sub
[/vba]
~'J'~
Hi Fatty:
Its not working, though it runs in the program without any VB errors.
any other ideas?
Thanks for the help!
Rob
Hi Rob,
it works for me in 2005.
did you copy it exactly and paste it into a module?
Steve
"Nearly all men can stand adversity, but if you want to test a man's character, give him power."
-Abraham Lincoln
Hay, RobOriginally Posted by RMS
Try this instead
Btw, I don't like SendCommand too because
this work differently in the different version
Here is adopted example from help
[vba]
Sub Ch_ViewDir()
'
'based on Direction Property Example in the Help file
'
Dim vecDir(2) As Double
' Define the valid keywords
Dim keywordList As String
keywordList = "Top Bottom Right Left Front BAck"
' Call InitializeUserInput to setup the keywords
ThisDrawing.Utility.InitializeUserInput 1, keywordList
' ' Prompt the user to input any of the keywords. Return "Top" "Bottom" "Right" "Left" "Front" or "Back" in
' the returnString variable depending on whether the user input "T" or "t", "B" or "B", "BA" or "ba", etc. .
Dim response As String
response = ThisDrawing.Utility.GetKeyword("Choose a view direction (Top)(Bottom)(Right)(Left)(Front)(BAck): ")
'MsgBox response 'debug only
'
' Define the direction vector , depending on the returned view name.
Select Case response
Case "Top"
vecDir(0) = 0: vecDir(1) = 0: vecDir(2) = 1
Case "Bottom"
vecDir(0) = 0: vecDir(1) = 0: vecDir(2) = -1
Case "Right"
vecDir(0) = 1: vecDir(1) = 0: vecDir(2) = 0
Case "Left"
vecDir(0) = -1: vecDir(1) = 0: vecDir(2) = 0
Case "Front"
vecDir(0) = 0: vecDir(1) = -1: vecDir(2) = 0
Case "BAck"
vecDir(0) = 0: vecDir(1) = 1: vecDir(2) = 0
End Select
' Change the direction of the viewport so that you can
' view the change made. Once you change
' the direction, you must reset the active viewport.
With ThisDrawing
.ActiveViewport.Direction = vecDir
.ActiveViewport = .ActiveViewport
End With
ZoomExtents
End Sub
[/vba]
~'J'~
Hay, LucasOriginally Posted by lucas
Glad to hear again
Thanks for the testing
Regards,
Oleg
~'J'~
Hi Oleg,
Same here, glad to see you still visiting the forum.
Steve
"Nearly all men can stand adversity, but if you want to test a man's character, give him power."
-Abraham Lincoln
Hey Lucas , yeah I did cut and paste not sure why it did not work.Originally Posted by lucas
How is everything in the guitar world!
Wow, Fatty, thats a lot of code! When I get back to work on Tuesday I will give that a try. I was not sure what to search for in the AutoCAD VBAOriginally Posted by Fatty
object browser.
By the way, I have been super bussy learning the C++ and its going really
good so far, but lots to learn!
Thanks for the help guys!!
Rob
Hi Rob
Unfortunatelly I am not so smart and not so young
to learn C++
I am enviuous on you by this reason )
Anyway I have to try to learn VB.NET instead, it's
easier a bit for me
Have you succes on this way
Cheers
~'J'~
Thanks Fatty, and good luck with the VB.NET !Originally Posted by Fatty
I read an artical the other night about the .NET stuff, one thing that stuck out was it has the ability to combine or merge languges, so you can write in it with your favorite programing language, not sure if I got this correct but here is the artical:
"....NET should help with that; it provides an environment where multiple languages can seamlessly co-exist (even on the class inheritance chain, or during debugging). So there should be less pressure to develop products monolithically in a single language; you'll use whatever language suits the task/suits you." -see #19 at bottom of this interview:
http://www.cpp-home.com/index/tiki-r...hp?articleId=3
its an old artical from 2002
Rob
Hi Rob,
Alice N Chains unplugged @ Cains Ball Room in Tulsa 2 weeks from now....we have our tickets.
Steve
"Nearly all men can stand adversity, but if you want to test a man's character, give him power."
-Abraham Lincoln
Wow, that band is incredable in two ways, there unpluged stuff is like no other rock band and when it comes to recording there hard rock stuff the guitars parts really just seem to stand out and jump out at ya... I don't know how to explain it I guess its just tallent all arround!Originally Posted by lucas
Thanks Rob,Originally Posted by Zrob
Interesting info btw
Good luck
~'J'~