Visual Basic Customization

Visual Basic Customization

Reply
Member
Peter.Huitsingh
Posts: 5
Registered: ‎05-09-2012
Message 1 of 1 (90 Views)

Viewports unfindable in Civil2013 through Code

90 Views, 0 Replies
11-26-2012 05:46 AM

I use VB6 to work with AutoCAD/Civil3D. With the new version 2013 I'm not able to find the viewports. It looks like the TypeOf is missing.

Private Function DeleteViewPorts(ObjectLayouts, arrayHandles)
'Delete Viewports not in the arrayHandles
Dim i As Integer
Dim ent As Object
Dim Handle As String
  For i = ObjectLayouts.block.Count - 1 To 0 Step -1
    If i < ObjectLayouts.block.Count Then
      Set ent = ObjectLayouts.block(i)
      If TypeOf ent Is AcadPViewport Or TypeOf ent Is IAcadPViewport Then
        Handle = ent.Handle
        If InArray(Handle, arrayHandles) < 0 Then
          ent.Delete    
        End If
      End If
    End If
  Next i
End Function

 I watch the object ent while it's changing. At the point it reaches a Viewport, the Watch notices it, but the if-statement (the TypeOf statement) doesn't recognize it. In 2012 it works very good.

 

Any help please.

 

Peter

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.