.NET

Reply
Contributor
deep_1984
Posts: 13
Registered: ‎01-13-2011
Message 1 of 6 (446 Views)

Customizing Audit command in C#.net

446 Views, 5 Replies
06-19-2012 05:20 AM

Hello,

There are some problems while attaching xrefs in Autocad 2013 it shows "eduplicaterecords" error and "Invalid" while attaching manually. But the functionality is working good in Autocad 2012 and below editions of Autocad.

This error is getting resolved when i  use "audit" command for Autocad 2013. So i want to customize this command.

Please help.

 

Regards,

Sandeep

 

Distinguished Contributor
Artvegas
Posts: 104
Registered: ‎04-21-2011
Message 2 of 6 (405 Views)

Re: Customizing Audit command in C#.net

06-22-2012 10:42 PM in reply to: deep_1984
I don't quite understand what you are asking. I assume the errors you refer to occur when you run your code? Without knowing the details, the eDuplicateRecord exception would indicate to me that you are trying to add an xref that already exists in your drawing? Why can't you fix your code? In terms of audit you could look into the Database.Audit() and DBObject.Audit() methods. I haven't looked at these myself.
Contributor
deep_1984
Posts: 13
Registered: ‎01-13-2011
Message 3 of 6 (374 Views)

Re: Customizing Audit command in C#.net

06-26-2012 11:12 PM in reply to: Artvegas

I have this error while attaching xrefs with the code db.AttachXref() method. This works fine for Autocad versions 2012,11,10. But it is not working for 2013. It works fine for autocad 2013 when i do audit command from autocad menu.

So thats why i wan to customize audit command in .net before attaching xref with db.AttachXref() menthode.

 

Regards,

Sandeep

Distinguished Contributor
Artvegas
Posts: 104
Registered: ‎04-21-2011
Message 4 of 6 (367 Views)

Re: Customizing Audit command in C#.net

06-26-2012 11:33 PM in reply to: deep_1984
Strange that it's not working for AutoCAD 2013 as I don't remember there being any documented changes to this part of the API. Anyways you could send AUDIT to the command line using Document.SendStringToExecute(). Depending on your requirements you might need to do this synchronously - i.e. using the COM interop AcadDocument.SendCommand() method and specifying CommandFlags.Session so that your code runs in the application context.
*Expert Elite*
dgorsman
Posts: 5,095
Registered: ‎10-12-2006
Message 5 of 6 (355 Views)

Re: Customizing Audit command in C#.net

06-27-2012 07:45 AM in reply to: deep_1984

Check the AutoCAD 2013 board, there have been problems reported with XREFs so I don't think its something in your programming.  I recommend waiting until the first SP to see if it has been adressed before trying to hard on a work-around.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
Adopt. Adapt. Overcome. Or be overcome.
A good question will be halfway to a good answer.


Contributor
deep_1984
Posts: 13
Registered: ‎01-13-2011
Message 6 of 6 (331 Views)

Re: Customizing Audit command in C#.net

07-18-2012 11:27 PM in reply to: deep_1984

Yes I will. I managed to this by giving error message to user. Thanks :smileyhappy:

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community