Help with AuditInfo constructor

Help with AuditInfo constructor

Paulio
Advocate Advocate
1,637 Views
4 Replies
Message 1 of 5

Help with AuditInfo constructor

Paulio
Advocate
Advocate

Can anyone help me with the constructor for the AuditInfo please?

 

I think I need to use AuditInfo.Create(type as system.type,unamanagedPointer as System.IntPtr, autoDelete as boolean) but I don't know what I should pass to it.

 

Can't do:

Dim ai As New AuditInfo()

 as "Sub New is not accessible in this context because it is 'Friend'"

 

I've had a look around but can't find a sample anywhere.

 

TIA

0 Likes
Accepted solutions (1)
1,638 Views
4 Replies
Replies (4)
Message 2 of 5

Paulio
Advocate
Advocate

OK. Got a bit further.

 

After a bit of (un)educated guessing I came up with this:

            Dim ai As AuditInfo = AuditInfo.Create(GetType(AuditInfo), db.UnmanagedObject, True)
            db.Audit(ai)

 but now I'm getting an 'eNotImplementedYet' error.

 

I finally figure out the constructor and then find out I can't use it yet! (unless I still haven't got the constructor right)

 

Is there no way to programmatically audit a database? I would use Tony T's commandline but can't becuse I'm looping through drawings in a folder which requires my commandmethod to have the sessionflags.

0 Likes
Message 3 of 5

Anonymous
Not applicable
Accepted solution

See the native ObjectARX docs for AcDbDatabase::audit

 

It's not implemented.

 

You can still use CommandLine to run AUDIT, but isn't that command

indeterminate (e.g., you can't anticipate what prompts it will issue) ?

 

For batch processing, you can use the classes in this sample,

which also solves the syncronous command problem:

 

  http://www.caddzone.com/AcBatchProcessSample.zip

 

 

0 Likes
Message 4 of 5

Paulio
Advocate
Advocate

Awesome! Thanks Tony.

 

I'd love to know how it works though!

0 Likes
Message 5 of 5

wesbird
Collaborator
Collaborator

Hi Tony:

  I tried your code, I found there are 2 files missing: Application.cs and ExtensionApplicaitonInfo.cs so I cannot compile it. Would you kindly provide a update version. I learn a lot from your code. I will keep doing so. Thank you so much.   

 

 

Wes

Windows 10 64 bit, AutoCAD (ACA, Map) 2023
0 Likes