PDA

View Full Version : problems using/debugging with revits API



focusproductions
2005-11-01, 07:34 PM
does anyone know if i have to do something special with my compiler for revit to run in debug mode. the only way now for me to see any results is to compile my code then run revit, which needless to say makes it a PITA to find errors. if anyone has any suggestions i would appreciate them.
by the way, im using microsoft visual studio 2003.
thanks

GuyR
2005-11-01, 07:43 PM
I don't use VS myself but what you need to do is under the project menu go to:

Configuration Properties->Debugging->Start External program and set the path to the Revit.exe

Under Start Options->Commandline arguments add a path to your test Revit project

HTH,

Guy

focusproductions
2005-11-01, 07:47 PM
see, i already have that done. every time i go to debug it tells me that there is an unhandled exception in revit.exe and that there is an access violation. which is really weird. because if i just run revit, everything is fine, it recognizes all the changes i have made, but when i run in debug mode i get nothing.
thanks

does anyone know what else could be causing this?
thanks for the help

Danny Polkinhorn
2005-11-02, 03:11 AM
Are you using 8.1? I vaguely remember the same thing happening to me with 8.0. I'm able to debug without any issues with VS 2003 and Revit 8.1.

There's no way around recompiling your code each time you want to run it, the only way to load it in Revit is with a dll or exe. Set your Revit.ini settings to load the dll from the bin directory.

Hope that helps,

focusproductions
2005-11-02, 02:23 PM
i am using 8.1. i am literally just trying to load revit through the compiler. it crashes when it tries to load revit when i run debug. the problem is, revit will run normally when i just run the .exe, but when i try to run my program in debug and it goes to open revit.exe, it just crashes out.
it crashes in the Utility.dll at 0x00a16fec, whatever function that is. if anyone can lend some help on this one i would greatly appreciate it.
thanks
steve

i can run the program through ctrl + F5(starting without debugging) in debug or release mode and it loads, it just doesnt like being run through the debugger. everytime it crashes in the same spot, in Utility.dll due to an acces violation of writing to a null pointer. also, this happens, with or without my modifications to the revit.ini file(for external command stuff).

GuyR
2005-11-02, 06:40 PM
You're using Revit Building not structural.

Guy

focusproductions
2005-11-02, 06:47 PM
that is correct

GuyR
2005-11-02, 07:27 PM
Catch 22. At this point I'd suggest a call to support. However with the API the only support available is via ADN ;-( Which you have to pay for. And given you're asking the question here then I don't think you're an ADN member. I'm out of ideas. Not a path issue is it?

Guy

Danny Polkinhorn
2005-11-02, 07:38 PM
Since Revit is crashing, I would submit a support request through your subscription.

focusproductions
2005-11-02, 07:45 PM
the bad part is i AM a member, and they cant seem to help me out very much either.
this is such a stupid problem. the guy responded by telling me to change some of the project properties, which are not present in my version of the compiler. hes using 2005 and i just dont have the setting he's trying to get me to change.
FUN STUFF

ps it's not a path issue.
thanks for your help guys.

GuyR
2005-11-02, 08:10 PM
No WAY, what does the money get you then ;-)!!! Does VS 2003 work with .NET? My only other suggestion is strip out all the curly stuff and try that, just a basic command. If that doesn't work try debugging one of the examples. If that doesn't work post a basic VS project that doesn't work for you and see if others can get it to debug?

Guy

focusproductions
2005-11-07, 08:20 PM
yeah, its a real pain. i sent them a base app which causes the same problem. and i assume theyre just scratching their heads about it. which is great. i mean im not in any huge hurry to get this thing working, but ya know, the sooner the better. and they havent been able to get back to me yet.

steve

focusproductions
2005-11-08, 03:35 PM
in case anyone else has this problem...

run revit.exe
in VS2003 go to tools->debugging processes
select revit.exe from the available processes listbox
click attach

also make sure in Configuration properties->general tab that "used managed extensions" is set to yes.
this process is something that has to be done on every debug run.
its not pretty but it seems to work. good luck everyone

steve