Author Topic: Set current Paperspace viewport - AutoCAD Mechanical  (Read 14270 times)

0 Members and 1 Guest are viewing this topic.

vegbruiser

  • Guest
Re: Set current Paperspace viewport - AutoCAD Mechanical
« Reply #15 on: December 03, 2010, 01:14:22 PM »
It seems I managed to answer my original problem after a bit of googling:
Quote
I think I might have just fixed this issue myself. After googling the exact error message:
 
"Unable to find an entry point named '?' in DLL"
 
I ended up here:
 
http://social.msdn.microsoft.com/forums/en-US/csharpgeneral/thread/a96468dc-9426-404e-ace7-0f7a1c8b4...
 
This then pointed me to http://www.dependencywalker.com/
 
After downloading and running this tool on acad.exe I found the function I was looking for.
 
tl;dr: use this:
 
Code: [Select]
?acedSetCurrentVPort@@YA?AW4ErrorStatus@Acad@@PEBVAcDbViewport@@@Z
instead of this:
 
Code: [Select]
?acedSetCurrentVPort@@YA?AW4ErrorStatus@Acad@@PBVAcDbViewport@@@Z
I'm not sure if this affects the 32 bit version of AutoCAD 2011, as I don't have it installed anywhere.

kaefer

  • Guest
Re: Set current Paperspace viewport - AutoCAD Mechanical
« Reply #16 on: December 05, 2010, 05:31:58 AM »
use this:
 
Code: [Select]
?acedSetCurrentVPort@@YA?AW4ErrorStatus@Acad@@PEBVAcDbViewport@@@Z
instead of this:
 
Code: [Select]
?acedSetCurrentVPort@@YA?AW4ErrorStatus@Acad@@PBVAcDbViewport@@@Z
I'm not sure if this affects the 32 bit version of AutoCAD 2011, as I don't have it installed anywhere.

[/quote]

Hi Alex,
of course it does. You're looking at the 64 bit signature above, and the original below is the 32 bit signature; at least with the 2010 release.

Didn't it occur to you just to scan for the text string "acedSetCurrentVPort" in the executable? That should be found at least two times,
because:

Acad::ErrorStatus acedSetCurrentVPort(int vpnumber);
Acad::ErrorStatus acedSetCurrentVPort(const AcDbViewport* pVp);

Cheers, Thorsten

vegbruiser

  • Guest
Re: Set current Paperspace viewport - AutoCAD Mechanical
« Reply #17 on: December 06, 2010, 04:43:32 AM »
After I had searched the executable using dependencywalker, it did indeed make sense.

I posted my findings here (and on the AutoCAD forums) in case anyone else was struggling with viewports on x64 versions of AutoCAD.

:)