.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

changes in DocumentCollectionEventArgs in 2013

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
inner_es
606 Views, 2 Replies

changes in DocumentCollectionEventArgs in 2013

this code used to work in AutoCAD 2007-2012, but not in 2013

 

    xAcad = Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication
    ThisDrawing = xAcad.ActiveDocument

    Public Sub AddDocumentToBeDestroyedEvent()
        Try
            AddHandler Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.DocumentToBeDestroyed, AddressOf subDocumentToBeDestroyed
        Catch
        End Try
    End Sub

    Public Sub subDocumentToBeDestroyed(ByVal senderObj As Object, ByVal docColDocActEvtArgs As DocumentCollectionEventArgs)
        '::::::::::::::::::::::::::::::::::::::::
        Try

            If ThisDrawing Is docColDocActEvtArgs.Document.AcadDocument Then
                

            Else

            End If
        Catch ex As System.Exception
            MsgBox("Error en docColDocAct: " & ex.Message)
        End Try
    End Sub

 

it sends the error 'AcadDocument' is not a member of 'Autodesk.AutoCAD.ApplicationServices.Document'

 

anybody knows the new way to check in both documents are equal?

2 REPLIES 2
Message 2 of 3
Alfred.NESWADBA
in reply to: inner_es

Hi,

 

>> it sends the error 'AcadDocument' is not a member of

>> 'Autodesk.AutoCAD.ApplicationServices.Document'

Use this code for 2013 the get the COM-object of the AutoCAD-document (im my snippet: AcadDoc)

Imports Autodesk.AutoCAD

...

CType(ApplicationServices.DocumentExtension.GetAcadDocument(AcadDoc), Interop.AcadDocument)

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 3 of 3
inner_es
in reply to: Alfred.NESWADBA

yep, this work

 

            If ThisDrawing Is CType(Autodesk.AutoCAD.ApplicationServices.DocumentExtension.GetAcadDocument(docColDocActEvtArgs.Document), Autodesk.AutoCAD.Interop.AcadDocument) Then

thanks a lot

 

regards

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost