chrisgeorge292 Posted April 25, 2022 Share Posted April 25, 2022 I am trying remotely debug a plugin with Eclipse and Pydevd on MAC OSX 10.15 and Landmark 2021. I have setup a 3.8 conda env for eclipse to match the native VW interpreter, and I can get the debugger to connect and break on a point. but after that it will just constanting freeze VW. im using pydevd 2.8.0 the latest version. Does anyone have any ideas? Quote Link to comment
chrisgeorge292 Posted May 10, 2022 Author Share Posted May 10, 2022 No one has any thoughts? Quote Link to comment
chrisgeorge292 Posted August 22, 2022 Author Share Posted August 22, 2022 Does have anything to do with Mac SIP protection? Quote Link to comment
Pat Stanford Posted August 22, 2022 Share Posted August 22, 2022 There are only a few people here using Python extensively. Let's see if I can help get anyone's attention. @twk@JBenghiat@The Hamma@Jayme McColgan@DomC Anyone have any ideas? Quote Link to comment
twk Posted August 23, 2022 Share Posted August 23, 2022 Sorry, I use Windows + PyCharm for remote debugging. Although whenever VW stalls during debugs, I just kill the debugger in Pycharm and it seems to release VW. Quote Link to comment
Peter Vandewalle Posted August 23, 2022 Share Posted August 23, 2022 I'm using Python / Eclipse on Mac OS also. I gave up on the debugger. It's just very unreliable. Quote Link to comment
DomC Posted August 23, 2022 Share Posted August 23, 2022 Hi I am using PyCharm CE and never tried remote debugging but it sounds interesting. I think there is improvement potential here, because honestly I do not know what a remote debugger would really improve and if it would be worth the effort 🙂 My (ammateur) Workflow: 1. import the vs.py methods in PyCharm to have intellisense and error-redlining 2. I have a string list which I append frequently with line-Numbers, comments from the code which i can write to a log file. So I can later find where my script stucked and maybe add further comments for more detailed debugging. 3. Or I just make some vs.Message() or vs.AlrtDialog() inside the script for quick and dirty checks. 4. For Script with user interaction (RunTempTool etc. ) I embed the python code into a pascal Script. Because there seems no Events that can make a python script is waiting for VW or VW wait for debugger?. Don't know how that would work with remote-debugging. Because I do not think a remote debugger can prevent from crashes (as example modification of a not anymore existing object-handle or similar.). Never tried myself to setup a remote debugger. Quote Link to comment
twk Posted August 23, 2022 Share Posted August 23, 2022 3 minutes ago, DomC said: 4. For Script with user interaction (RunTempTool etc. ) I embed the python code into a pascal Script.. What is this black magic you speak of? Quote Link to comment
DomC Posted August 23, 2022 Share Posted August 23, 2022 I guess no magic you do not already know.😉 And this inside the python code: Newly I found the method here in the forum to write the values directly to value repository. Which is more clean than values2python function. What I did not used yet is go back to pascal and do further interactions and then start next python script. But I think this should work. While pascal seems to be nativ-integrated in VW, python have much more comfort to create code or access to OS. So combining pascal and python seems to be very attractive for scripts. Next step would be C++. But I am scared from having so much more "magic". 2 Quote Link to comment
twk Posted August 23, 2022 Share Posted August 23, 2022 This is very interesting, I've never thought to use the interaction tools like this. Would this mean that we would have to run separate scripts lanuages for either operation? ie (pascal for interaction, python for everything else). Quote Link to comment
DomC Posted August 23, 2022 Share Posted August 23, 2022 2 hours ago, twk said: Would this mean that we would have to run separate scripts languages for either operation? ie (pascal for interaction, python for everything else). I wish not that we need to do this but it seemed to be necessary if i have python scripts and wants to interact with Vectorworks while script is running. Theoretically is should work with a python script, if we use the python script as a callback of the temp tool and additionally tweaks. But that seems to be even more unstylish, then embed everything into pascal scripts which handle user interactions. Can't estimate if this disadvantage of python code inside VW technically and reasonable at all can be eliminated. Quote Link to comment
Jayme McColgan Posted September 14, 2022 Share Posted September 14, 2022 I'm currently using VS code to do all my programming. i haven't really looked into remote debugging but it is on my long.... list to add to my workflow. Quote Link to comment
chrisgeorge292 Posted September 15, 2022 Author Share Posted September 15, 2022 Thank you all for the responses! So it seems no one is having much luck with attaching a remote debugger to vectorworks. Twk mentioned being able to kill the debugger process on windows and it releasing Vectorworks. I have not had the same luck with MacOS unfortunately. Like DomC said, I have used vs.AlrtDialog to provide debugging hints, but it can get so painful while debugging loops since it creates sooo many alerts. Quote Link to comment
MullinRJ Posted September 16, 2022 Share Posted September 16, 2022 @chrisgeorge292, If you are waiting for a specific occurrence in a loop, you can always nest the vs.AlrtDialog() call in an "if" statement. You can wait for the loop counter to reach a certain point, say 70: for X in range [1, 81]: if X >= 70: vs.AlrtDialog(vs.Concat("I'm here: X= ", X)) or, an object to reach a certain type: Hnd = vs.FSActLayer() while Hnd != 0: if vs.GetType(Hnd) == 10: # Text object vs.AlrtDialog(vs.GetText(Hnd)) Hnd = vs.NextObj(Hnd) There are endless ways to configure a test for your stopping point. The filter condition can be simple, or complicated. Often the time you spend crafting a filter will save you stepping through a lot of unnecessary steps, especially if you have to run the code more than once. If it doesn't save you time, then don't do it. HTH, Raymond Quote Link to comment
Sam Jones Posted September 16, 2022 Share Posted September 16, 2022 I apologize for being so late to the party, but what is "remote debugging" Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.