Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attach debugger to pyrevit process when creating extension scripts #593

Closed
buckettt opened this issue May 10, 2019 · 5 comments
Closed

Attach debugger to pyrevit process when creating extension scripts #593

buckettt opened this issue May 10, 2019 · 5 comments
Labels
Enhancement Enhancement request [class->Improved #{number}: {title}]

Comments

@buckettt
Copy link

buckettt commented May 10, 2019

Is your feature request related to a problem? Please describe.
When creating custom scripts and extensions the current debugging process is tactically placed print statements and inspection of the logs. This can make the process longer than necessary when compared to using more typical debugging methods.

Describe the solution you'd like
The ability to attach a debugger to the pyrevit script process. Alternatively launch the process from an IDE (Visual Studio Code). This could allow easier inspection of variables and the inclusion of breakpoints to efficiently debug and develop new scripts.

Describe alternatives you've considered

Additional context

@eirannejad
Copy link
Collaborator

@buckettt Please fill in the questions above. The title doesn't tell me much

@buckettt
Copy link
Author

buckettt commented May 13, 2019

@eirannejad Apologies I thought I had filled it in...

@eirannejad eirannejad added the Enhancement Enhancement request [class->Improved #{number}: {title}] label May 13, 2019
@eirannejad eirannejad added this to the v5.0 milestone May 17, 2019
@eirannejad eirannejad removed this from the v4.7 milestone Oct 12, 2019
@eirannejad
Copy link
Collaborator

Implemented in 4.8.1

@Kormaican
Copy link

(Please redirect me if I'm out of place here)

Looking for the PyRevit debugger. From this it seems like there is a debugger implemented, but I have been having trouble finding anywhere that describes how to use it. Any suggestions?

Most of the forums I find talk about using print statements or such, so hoping for something that would allow me to set breakpoints in my code. Maybe that's not the kind of debugger this is, but if someone could redirect me where to look.

For reference, I have a decent amount of coding experience, just haven't had the time to go hunting through the entire repository file by file.

@sanzoghenzo
Copy link
Contributor

Looking for the PyRevit debugger. From this it seems like there is a debugger implemented, but I have been having trouble finding anywhere that describes how to use it. Any suggestions?

You have to add the following line where you want to start the debug:

import pdb; pdb.set_trace()

This is just the standard, built-in way to debug python code; it will open up an output window with some useful buttons.

To learn how to use it, follow one of the guide you can find with google.

I encountered an issue a while ago (you can see it here), so be aware that using the debugger can cause some crash that is unrelated to your script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Enhancement request [class->Improved #{number}: {title}]
Projects
None yet
Development

No branches or pull requests

4 participants