Looking for Explanation - ThisDocument and Zoomscaled

The VBA forum deals with IntelliCAD 2000 VBA (Visual Basic for Applications) issues.

Moderator: CMS Inc

Post Reply
jwhitla
Newbie
Posts: 2
Joined: Fri Nov 16, 2007 5:59 am
Location: N Ireland

Looking for Explanation - ThisDocument and Zoomscaled

Post by jwhitla » Fri Dec 21, 2007 6:22 am

Hello,
I'm using version 6.4.23.2 to convert some old Autocad VBA macros and I'm storing all my programs in Common Projects.
Can anyone shed some light on the following:

1) Why I don't have access to ThisDocument and have to use ThisWorkspace.ActiveDocument instead.

2) At the end of the macros, I am attempting to Zoom Extents followed by a Zoom Scale to slightly reduce the view of the drawing.
The ZoomExtents works OK but ZoomScaled is giving a
' Compile Error: = expected'

In Autocad I simply used:
ZoomScale 0.9, acZoomScaledRelative

In Intellicad I have tried
ThisWorkspace.ActiveDocument.ActiveViewport.ZoomScaled (0.9,vicZoomScaledRelative)
but when I type the finishing bracket I get the Compile error message above.

Regards
Jim :?
John Finlay

Post by John Finlay » Sat Jan 12, 2008 1:33 pm

jwhitla,

As far as the access to ThisDocument goes: I have always used IntelliCAD.ActiveDocument so I can't help you there.

The zoom works without error when I use:
ThisWorkspace.ActiveDocument.ActiveViewport.ZoomScaled 0.9, vicZoomScaledRelative

The error occurs when brackets are placed around the arguments as VBA needs a pointer to a variable.
jwhitla
Newbie
Posts: 2
Joined: Fri Nov 16, 2007 5:59 am
Location: N Ireland

Zoom Scaled - Problem Solved

Post by jwhitla » Sun Jan 13, 2008 8:04 am

Thanks John,
Works a treat. I'll remember about the brackets in the future.
Post Reply