-
Notifications
You must be signed in to change notification settings - Fork 85
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
Could not determine the Run mode of this Dynamo script! #32
Comments
@Bulkov Hi there It may be to do with a new Dynamo workspace file format... can you make a copy of your script, remove whatever is there and send me the file? I suspect I'll need to account for the newer format in Dynamo 2.x+ versions. |
Enable Python support and load DesignScript libraryimport clr clr.AddReference("RevitAPI") clr.AddReference("RevitServices") doc = DocumentManager.Instance.CurrentDBDocument The inputs to this node will be stored as a list in the IN variables.dataEnteringNode = IN collector = FilteredElementCollector(doc) filter = ElementCategoryFilter(BuiltInCategory.OST_RvtLinks) links = collector.WherePasses(filter).ToElements() Assign your output to the OUT variable.OUT = links Is this what your looking for? Sorry for being so dense. |
lol that looks like crap. The bold is comments obviously. sorry |
Sorry I wasn't clear, I just need a copy of your Dynamo script workspace file (.dyn). You can remove nodes if you want before attaching it, I just need to see the file format itself (it's probably a json or xml file). |
I made it with 2.x so im guessing your right it is json and the Batcher is for xml? If you get this to work I can't even explain how much of as bad ass you will make me look like. I am trying to delve further into the rabbit hole of pythonshell, and designscript to simplify my graphs and make things a little more user friendly for my firm. I appreciate you responding so quickly. It seems like this community of developers is extremely helpful. Hopefully one day I can be on your end of the stick and help develop more. |
Yep the error is due to the change in format to JSON for Dynamo 2+. I didn't account for that probably because my test scripts were upgraded from Dynamo 1.3 so they were still in XML format. I'll release a new version over the next day or so with the fix and get you to test that the fix works for your script. (You could try building from source code with the latest changes/commits if you feel confident doing so, or just wait until I've released the new version...) Apologies about the glitch and thanks for reporting this because I probably wouldn't have noticed a problem for a while! BTW the error messages that start with |
As for developing programming skills, the best way to learn it is just to dive in and struggle until it starts to become easier. :) Like anything it takes practice. I would definitely recommend learning python (IronPython in particular for Revit API development). C# isn't too hard after learning IronPython as they share the same windows API (.NET). |
Dan,
I am diving in right now. So far so good. Thank you so much for the
support for your tool. Let me know when you have it updated and I will
ginnie pig all you want. Good to know those other error messages are
nothing. That is kind of what I assumed. Also I noticed it says that when
the dialog comes up to save the model it clicks no. is it actually not
saving? If so I guess I could figure out how to get it done in the
script. I am close to converting the dynamo graph I am trying to work with
into a standalone python script. So I am sure I will be able to figure out
the save thing. JacobSmall gave me some really good resources and I am
going through the youtube videos that the developer of pyRevit made. What
a great community of support. And free of judgement for beginners like me.
Best,
…On Wed, Apr 24, 2019 at 9:13 AM Dan Rumery ***@***.***> wrote:
As for developing programming skills, the best way to learn it is just to
dive in and struggle until it starts to become easier. :) Like anything it
takes practice. I would definitely recommend learning python (IronPython in
particular for Revit API development). C# isn't too hard after learning
IronPython as they share the same windows API (.NET).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#32 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AL4SPFB5HWLF5DX5VDJ6OW3PSBMI7ANCNFSM4HHSKDBA>
.
--
Nick Dull
BIM Technician
Emerald Engineering Inc.
office 813.995.0300 | mobile 941.720.6796
9942 Currie Davis Dr., Ste. H, Tampa, FL 33619
emeraldmep.com
|
Lol. The pyRevit guy literally just went over starting and commiting transactions. |
Dan, I just wanted to update you on my progress. I was able to convert the dynamo graph I wanted to run into a stand alone python script. Unfortunately I am still running into errors. Maybe you could take a look at what I have and throw me a bone to make my .py file able to run with your batch processor. When I run the script in the python shell it works beautifully. I am attaching all my log files from today as well as the script that runs fine in shell but not during batch. Hopefully it is just one post and everything formats well. :) |
Hi @Bulkov I've uploaded a pre-release with support for newer JSON-based Dynamo workspace files. Can you remove the previous installed version, install the new version (1.5.1) and let me know if that solves this particular issue for you? https://github.com/bvn-architecture/RevitBatchProcessor/releases/tag/v1.5.1 |
@Bulkov The python task script will need some initialization code specific to RBP. If you generate a new python script via the RBP GUI (the 'New Script' button) and inspect the new script, you'll see what that initialization code looks like. You'll notice that the initialization code sets the Revit document to |
@Bulkov Also, regarding the save file dialog dismissed in the log file output, this is because RBP leaves it up to your python or Dynamo script to perform a Save (or Synchronize) as needed. RBP can open, detach or create a new local file, but the rest is left up to the script to perform mostly because there are a lot of different potential workflows there. |
Awesome! Thanks Man! It worked great but of course did not save. So I will build something into my graphs and scripts. Thanks for the heads up on that initialization code. Do you mention that in the original post for RBP? If so, sorry for not looking a little harder. Best, |
Should I close this issue? or do you do that? I would assume you can since its your project. As far as I am concerned my issue is solved. I will let you know if I find anymore bugs. |
Thanks @Bulkov glad it worked. I do mention it in the README but I should probably add a FAQ/Wiki to avoid confusion. |
I am trying to use this tool to iterate a dynamo script through many models with one click. I keep getting the error message: "Could not determine the Run mode of this Dynamo script!" I have tried starting brand new project and brand new graphs. I have made sure I only have one version of dynamo installed. What else am I missing? I am trying to convert my simple graph into designscript so maybe if I can get some help doing that I could bypass needing to run via Dynamo. I will attach where I am with the script. Thanks to anyone who can help!
Scripting.pdf
The text was updated successfully, but these errors were encountered: