.NET

.NET

Reply
*Expert Elite*
GTVic
Posts: 929
Registered: ‎09-07-2004
Message 1 of 4 (1,268 Views)
Accepted Solution

2013 AcadDocument.Regen and Application.MainWindow.Location (.Size)

1268 Views, 3 Replies
04-26-2012 03:20 PM

I previously found that CurrentDoc.Editor.Regen() did not work well in my application so I was using a different method.

 

I have found that the following are no longer available in 2013. I'm looking through the ObjectARX SDK documentation right now but so far not able to find where these methods have gone.

 

CurrentDoc.AcadDocument.Regen(1)

Application.MainWindow.Location

Application.MainWindow.Size

 

Thanks

 

I had previously viewed this presentation. The presentation states that the What's New section of the ObjectARX documentation reviews all of the new extension classes. In fact the What's New section lists only the DocumentExtension class.

 

I was able to find the GetAcadDocument function in the DocumentExtension class. This function apparently wraps an ObjectARX class which isn't named (searching the ObjectARX SDK for that name comes up with nothing). This function returns an Object.

 

As with previous versions the class AcadDocument isn't documented but the acadi.h file lists the functions available including Regen which accepts one arguement which can be either acActiveViewport = 0 or acAllViewports = 1.

 

Imports Autodesk.AutoCAD.ApplicationServices.Application
Imports Autodesk.AutoCAD.ApplicationServices.DocumentExtension
Dim AcadDoc As Object
AcadDoc = GetAcadDocument(DocumentManager.MdiActiveDocument)
AcadDoc.Regen(1)

I was able to find the window extension by guessing at its location and the following functions should provide the correct information.

 

Imports Autodesk.AutoCAD.Windows.WindowExtension
Imports Autodesk.AutoCAD.ApplicationServices
Dim AcadTopLeft, AcadMid As System.Drawing.Point
Dim AcadSize As System.Drawing.Size
AcadTopLeft = GetLocation(Application.MainWindow)
AcadSize = GetSize(Application.MainWindow)

 

ADN Support Specialist
StephenPreston
Posts: 429
Registered: ‎05-22-2006
Message 2 of 4 (1,259 Views)

Re: 2013 AcadDocument.Regen and Application.MainWindow.Location (.Size)

04-26-2012 06:15 PM in reply to: GTVic

I think you'll find these methods/properties have been moved to extension methods in AutoCAD 2013. See the video on .NET migration I posted here for an explanation: http://adndevblog.typepad.com/autocad/2012/04/migrating-objectarx-and-net-plug-ins-to-autocad-2013.h...

 

 

Cheers,

Stephen Preston
Autodesk Developer Network
*Expert Elite*
GTVic
Posts: 929
Registered: ‎09-07-2004
Message 3 of 4 (1,224 Views)

Re: 2013 AcadDocument.Regen and Application.MainWindow.Location (.Size)

04-30-2012 12:04 PM in reply to: StephenPreston

I had previously viewed this presentation. The presentation states that the What's New section of the ObjectARX documentation reviews all of the new extension classes. In fact the What's New section lists only the DocumentExtension class.

 

I was able to find the GetAcadDocument function in the DocumentExtension class. This function apparently wraps an ObjectARX class which isn't named (searching the ObjectARX SDK for that name comes up with nothing). This function returns an Object.

 

As with previous versions the class AcadDocument isn't documented but the acadi.h file lists the functions available including Regen which accepts one arguement which can be either acActiveViewport = 0 or acAllViewports = 1.

 

Imports Autodesk.AutoCAD.ApplicationServices.Application
Imports Autodesk.AutoCAD.ApplicationServices.DocumentExtension

Dim AcadDoc As Object
AcadDoc = GetAcadDocument(DocumentManager.MdiActiveDocument)
AcadDoc.Regen(1)

I was able to find the window extension by guessing at its location and the following functions should provide the correct information.

 

Imports Autodesk.AutoCAD.Windows.WindowExtension
Imports Autodesk.AutoCAD.ApplicationServices

Dim AcadTopLeft, AcadMid As System.Drawing.Point
Dim AcadSize As System.Drawing.Size

AcadTopLeft = GetLocation(Application.MainWindow)
AcadSize = GetSize(Application.MainWindow)

 

Valued Contributor
StormyC
Posts: 82
Registered: ‎11-19-2010
Message 4 of 4 (329 Views)

Re: 2013 AcadDocument.Regen and Application.MainWindow.Location (.Size)

02-21-2014 07:19 AM in reply to: GTVic
Thank you very much for sharing that, I'm certian it saved me a few hours ...
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.