Message 1 of 4
Changing modelspace views with VBA

Not applicable
09-10-2008
03:58 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I wish to provide a capability of swapping the view of the drawing
between "plan", "front elevation", "side elevation" and the standard
isometric views. Searching help files and the Object model I have not
been able to find an API for this. It seems an obvious item for there
to be an API.
I've been playing with "Sendcommand" as an alternative, but find it
unreliable in that sometime it works and other times it stacks the
commands and runs then when I exit my program.
Select Case Combobox.ListIndex
Case 0
ThisDrawing.SendCommand "-view" & vbCr & "_top" & vbCr
Case 1 '<--- "Front elevation"
ThisDrawing.SendCommand "-view" & vbCr & "_front" & vbCr
Case 2 '<--- "Side elevation"
ThisDrawing.SendCommand "-view" & vbCr & "_left" & vbCr
Case 3 '<--- "SW Isometric"
ThisDrawing.SendCommand "-view" & vbCr & "_swiso" & vbCr
Using vbcrlf or vbcr makes no difference.
Regards
Laurie Comerford
I wish to provide a capability of swapping the view of the drawing
between "plan", "front elevation", "side elevation" and the standard
isometric views. Searching help files and the Object model I have not
been able to find an API for this. It seems an obvious item for there
to be an API.
I've been playing with "Sendcommand" as an alternative, but find it
unreliable in that sometime it works and other times it stacks the
commands and runs then when I exit my program.
Select Case Combobox.ListIndex
Case 0
ThisDrawing.SendCommand "-view" & vbCr & "_top" & vbCr
Case 1 '<--- "Front elevation"
ThisDrawing.SendCommand "-view" & vbCr & "_front" & vbCr
Case 2 '<--- "Side elevation"
ThisDrawing.SendCommand "-view" & vbCr & "_left" & vbCr
Case 3 '<--- "SW Isometric"
ThisDrawing.SendCommand "-view" & vbCr & "_swiso" & vbCr
Using vbcrlf or vbcr makes no difference.
Regards
Laurie Comerford