PViewport and ZoomCenter

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

Moderator: CMS Inc

Post Reply
fixtureitman
Newbie
Posts: 1
Joined: Wed Oct 21, 2009 1:01 pm

PViewport and ZoomCenter

Post by fixtureitman » Wed Oct 21, 2009 2:16 pm

I am using VBA to create a layout tab and add a PViewport. I am able to add the PViewport successfully but want to use the ZoomCenter method to zoom into an area in model space through the PViewport.

Here is the sample code...

'viewport settings: Layer = vport: Center = 17.717,12.292:
' Height = 23.510: Width = 30.000
Set objPoint = IntelliCAD.Library.CreatePoint(17.717, 11.755, 0)
Set objViewport = IntelliCAD.ActiveDocument.PaperSpace.AddPViewport(objPoint, 30, 23.51)
objViewport.Display True
objViewport.Layer = "vport"
IntelliCAD.ActiveDocument.ActivePViewport = objViewport
IntelliCAD.ActiveDocument.MSpace = True
Set objPoint = IntelliCAD.Library.CreatePoint(MyPanelScheduleGrid.PageCenterItem(intCnt).X, MyPanelScheduleGrid.PageCenterItem(intCnt).Y)
IntelliCAD.ActiveDocument.ActiveViewport.ZoomCenter objPoint, 10

This is the error message I get when the zoomcenter method is executed.
"Run-time error '438': - Object doesn't support this property or method"

The help file shows the ZoomCenter method for both the Viewport and PViewport objects. However it appears the PViewport object doesn't support the ZoomCenter method.

I also used .ActiveViewport.ZoomCenter objPoint, 10 and I get the following error message...
"Run-time error '-2145467259 (80004005)': Method 'ActiveViewport' of object 'IIcadDocument' failed.

Has anyone used the ZoomCenter methods for either Viewport or PViewport objects?

Does anyone know of a book or other resource for the Intellicad objects and how VBA interacts?

I have a book for AutoCAD 2000 VBA which shows examples of code for all of the AutoCAD objects and methods. I would like to find a similar resource for Intellicad.

Thanks,
Post Reply