A working button

Hello, Here’s what I have so far, I’ve got my dialog box to pop up with my message, but i want to be able have both these buttons close the window, but I want to know what button the user pushed. I know this would probably be a little easier with check boxes, but I already know how to use those and I’m slowly trying to learn more if possible.

image

Here’s a portion of my code. just what deals with adding the buttons

image

Hi Richard,

I would recommend that you have a look at what Danny Bentley does within this video.

Of where he create a function that get call when the user click on button meaning you could add what ever you want inside it. Hope that helps.

Ben

Why don’t you post ALL of the code so that someone can actually re-create the issue. Also, don’t post it as an image. You can copy paste code into the question and it will be properly formatted. If you don’t know how, please google it.

Didn’t know you could paste formatted code here, newish to the form, my apologies. That particular node I’m working on is nearly 700 lines of code at the moment, seeing as you don’t know my inputs and there was so much coding in that node, I didn’t feel it was useful to paste it all in… and before I knew you could paste formatted code that screen shot was about the biggest window I could get…

Also, I can’t post my dynamo code because its searching through the open file, 4 linked files, multiple Excel spreadsheets all saved on my companies internal network and hard coded into the file, so there’s no feasible way of anyone actually testing the program itself.

Awesome, I should have time this Friday to give this video a watch, I’ll let you know if it works, thanks!

Actually this could be tested without much effort. You’d be amazed at what can and has been tested on these forums in the past. If you’re worried about spilling company secrets, then boil down the python to just the section that triggers the pop up and people can help troubleshoot that directly.

As an alternative to ‘all python all the time’, have you considered utilizing the datashapes package for this? Not only does it perform and record the action as requested, but you can also leverage managing that package to make future utilization and maintenance easier.

2 Likes

You don’t have to paste the whole code. The idea is that you give us a Minimal, Complete and Verifiable sample. This link has an explanation here: https://stackoverflow.com/help/mcve

3 Likes

@Konrad_K_Sobon That’s a super helpful link and will for sure take it under advisement for any other posts in the future, thank you for your input!

@jacob.small On the same note, thanks for the input, I will for sure keep that in mind and make sure I give you guys some more detail to work with next post, I’m out of the office today so I can’t get into Dynamo to mess around with it today.
As it relates to all Python all the time, I have two reasons for using that mindset. I’ve got a couple projects I’m working on in my time project work is at a low (I’m an electrical engineering at a consulting firm), although to me and arguably most the younger generation Dynamo player is intuitive, these projects are on track to be rolled out to a nationwide company… We have a hard enough time getting people to switch from AUTO CAD to Revit… introducing new things like “the dynamo player” to most the company simply just doesn’t stick and people won’t use…
So A: I’m a self taught coder, I’m using Dynamo as a “primer” to learn C# and write add ins that can be placed in the normal command ribbons in Revit and run a ton faster… and making ribbon add ins is a little more native to unfamiliar Dynamo users. Seems to be a decent learning experience to slowly try to code my own python nodes even if nodes exists that already do the task.
And B: I’m sure there’s a way but I haven’t been able to find a reasonable way to make a Dynamo handle all the different circumstances I’m trying to throw at it. I.e. we lack standards in the company, with it being so large, so many variations in the way people do things is quite evident. I can’t seem to make a fully Dynamo node graph run efficiently and handle errors without shutting the whole program down… Before I ventured to Python nodes my graphs were taking like 4 minutes to run and freezing Revit… Lost a lot of work and progress in the process and it wasn’t feasible to release anything to my company that was taking that long to run (yeah in retrospect it’s not that long, but try to explain that to non-Dynamo users)

Data shapes is AWESOME. I love that add in, super useful, great job to whoever coded that. Far beyond my skill level at this point. The only reason I don’t use it is because when someone goes to run the script on their machine that doesn’t have that add in installed… clearly it won’t run. We can barley keep up with software updates for the company, no way IT is going to throw in updating and adding Dynamo libraries to every computer in the company. Sure I could copy and paste the node into the actual graph and not use the library node, but when new Dynamo updates come out, or Revit changes, I have no clue how to go in and fix a node I didn’t write… Heck I can barley fix my own.

Sorry for the book.

@Richard.vojtisek
tip:

make a folder on a network drive

download the version of the package you prefer from www.dynamopackages.com

put all packages in there

delete local packages

Settings>>Manage node and network paths

Correct me if I’m wrong but that would only manage the node and network paths for my personal machine right?

@Richard.vojtisek

so, set the path on all computers

Books are good - doubly so when productively on topic the way this one was. :slight_smile:

The advantage to the packages in dynamo is that they’ll be easier to update long term. If (ok let’s be real - when) any given code syntax or API calls change you’ll have to update each version of each graph in the entire organization. And managing those add-ins can be as tricky as managing packages, doubly so as other add-ins and the many possible combinations are put into the mix.

Using a network location for you (and all coworkers) will ensure everyone is synced up. Editing that path is fairly simple by modifying the settings file. It’s likely the easiest way to manage these. You can also have them copied onto the default path at login or when changes are necessary via GLP or other method, but that’d involve more work by the IT group.

Datashapes can trigger in succession (or not) based on UI input as well which is quite nice. However I believe it’s mostly a zero touch package, which means there is no easy way to reverse engineer them as you mentioned.

PS: Welcome to the wonderful world of software management. :wink:

1 Like

I’m starting to begin to wonder if all this software management is a bit more than I singed up for when I joined this company as an electrical engineer. :thinking:

Anyways, thanks for all the input, not what I set out to find when I created this post but all this feedback has been super helpful and probably even more useful than what intended to find!

2 Likes