Exchange Forum > ActiveX and VBA
How to activate Modelspace in VBA
How to activate Modelspace in VBA

#1

Chavez
Join Date:
08-06-2007
I'm working on a routine that needs to run in Modelspace. I've tried a few things without success.
Here's what I've got so far.
Code:
Sub Test()
 ThisDrawing.ActiveSpace = ModelSpace
End Sub
How to activate Modelspace in VBA

#2

Space Cadet
Join Date:
07-27-2007
You've almost got it right. Just add an "ac" before "ModelSpace".
Code:
Sub Test()
  ThisDrawing.ActiveSpace = acModelSpace
End Sub
How to activate Modelspace in VBA

#3

DeCipher
Join Date:
08-02-2007
Another method that always works is:
Code:
Sub Test()
 ThisDrawing.ActiveLayout = ThisDrawing.Layouts("Model")
End Sub
How to activate Modelspace in VBA

#4

Chavez
Join Date:
08-06-2007
I tested your suggestions and they both work. Thanks.