VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Viewports unfindable in Civil2013 through Code

0 REPLIES 0
Reply
Message 1 of 1
Peter.Huitsingh
242 Views, 0 Replies

Viewports unfindable in Civil2013 through Code

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

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost