Help about change view in VBA

Help about change view in VBA

Anonymous
Not applicable
990 Views
3 Replies
Message 1 of 4

Help about change view in VBA

Anonymous
Not applicable

Deer all,

 

I have a question and hope you can help me. Sorry for my stupid in Autocad 😞

 

In my command line, when I type "-vp" and next "1,1,1"

Autocad will change view.

 

How I can do what similar in VBA.

 

Hope you can help me as soon as possible.

 

Thank alot.

0 Likes
991 Views
3 Replies
Replies (3)
Message 2 of 4

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

it depends what you want to do then. As long as you are not close enough to development and AutoCAD itself I would do that with SendCommand:

    Call ThisDrawing.SendCommand("_VPOINT" & vbCr & "1,1,1" & vbCr)

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 3 of 4

Hallex
Advisor
Advisor

Try this code

          Public Sub setView()
          Dim vdir(0 To 2) As Double
          vdir(0) = 1: vdir(1) = 1: vdir(2) = 1
          ThisDrawing.ActiveViewport.Direction = vdir
          ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport

          End Sub

 

~'J'~

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
0 Likes
Message 4 of 4

Anonymous
Not applicable

Thanks you so much. I will try both of them.

 

0 Likes