Hi Danny Bently, the text is hardly visible, can u record in big fonts size
@HippieP6296 жыл бұрын
Thank you so much for sharing your knowledge both here and on your blog! As a coding noob, it's really helpful to see how c# is applied to Revit.
@gutibokeron3 жыл бұрын
Great video! thanks! May I suggest use fullscreen for easy following!
@BittuGhosh-o2e Жыл бұрын
Hi Danny, I have already been through all your c# videos, has really helped to get a better understanding of the Revit Api. I would really like to try to have buttons on the other which i have crated for panel2 in a RibbonPanel. Any chance you can make a video of that or explain the logic. I have managed to get it working, but not sure if copying and pasting code is really a sustainable method. Cheers
@หนังสยองขวัญผี7 жыл бұрын
#Danny Bentley Can you zoom CODE ?
@Lichtschalter7 жыл бұрын
Hey Danny... where would i post the code for example if i want to press the Button and the Message "Hello World" would pop out.
@DannyBentley7 жыл бұрын
Here is some sample code for "Hello World" Popup. public Result Execute( ExternalCommandData commandData, ref string message, ElementSet elements) { TaskDialog.Show("Revit", "Hello World"); return Result.Succeeded; }
@Lichtschalter7 жыл бұрын
but i want to paste it in the "Tab and the Button"-code to pop out the message after pressing the Button
@DannyBentley7 жыл бұрын
When you push the button the App.cs file which is the button will go through the code action/event trigger. PushButton button = panel.AddItem(new PushButtonData("Button", "Test Button", thisAssemblyPath, "MyTest.Command")) as PushButton; The action will run Command.cs file that is the class Command. This will start of your wonderful Hello World program. public class Command : IExternalCommand { public Result Execute( ExternalCommandData commandData, ref string message, ElementSet elements) { TaskDialog.Show("Revit", "Hello World"); return Result.Succeeded; }
@Lichtschalter7 жыл бұрын
thank you very much!
@หนังสยองขวัญผี7 жыл бұрын
Thank Danny Bentley .I hope you will make many new lesson .
@DannyBentley7 жыл бұрын
If you have any suggestion or things you'd like to learn on the Revit API please let me know.
@bimconsaultantshawaii7 жыл бұрын
Thanks for this video. It was blurry as heck. Can you post a link or copy of that code as an example?
@DannyBentley7 жыл бұрын
Hello Kristofer, I'm working on getting better software for the videos, but I've also increased the size of the font in newer videos. I have a blog where I post my code here: revitdynamoapi.blogspot.com/2017/02/beginners-guide-to-adding-tab-and.html If you need more help feel free to reach out to me. DB.
@wojciechtecaw59375 жыл бұрын
Thanks for sharing! Is it possible to compile python code to get similar result? How to compile that code?
@ricardozepeda14287 жыл бұрын
Thanks Danny great video! keep posting! one small question, any particular reason why the icon its not visible when you add the button to the quick access tool bar ?
@DannyBentley7 жыл бұрын
Hi Ricardo, Yes you're correct. The image will not show up on a quick access toolbar. The reason I used a large image of 32x32 pixels. For quick access, you need a 16x16 pixel or else it will not show up.
@jamessteele536 жыл бұрын
Hi Danny, I have already been through all your c# videos, has really helped to get a better understanding of the Revit Api. I would really like to try to have multiple buttons in a RibbonPanel. Any chance you can make a video of that or explain the logic. I have managed to get it working, but not sure if copying and pasting code is really a sustainable method. Cheers
@DannyBentley6 жыл бұрын
Hi Frederich, You are starting to move from beginner to advance. To add another button to a panel you would just do something like this. PushButton button1 = panel.AddItem(new PushButtonData("Button1", "API Button", thisAssemblyPath, "MyTest.Command1")) as PushButton; PushButton button2 = panel.AddItem(new PushButtonData("Button2", "API Button", thisAssemblyPath, "MyTest.Command2")) as PushButton; If you have a seprate project which most of the time this happens just call for the same panel then add your button. I hope this helps.
@sarahassan98956 жыл бұрын
hi i'm already make a Tab and Button, but i want give Action to Button, like i want to make it open CMD after press on it, i'm already have another project using C# able me to open CMD so how can i connect them by each other , how can make this button active to open another project or specific CMD ?????????
@DannyBentley6 жыл бұрын
Hi Sara, If you are using WPF then double click on the button. You should get an event handler code. It should look something like this. private void CMD_Click(object sender, RoutedEventArgs e) { // This will run when your button is clicked. // Add logic here or call this in a separate class to keep code clean. }
@albobball7 жыл бұрын
Danny, I cannot figure out why my image is not pulling up. The rest of the code is working just fine however. I saved my .png image in the debug folder where my dll is. am i supposed to reference somewhere in my addin? I guess I am not really understanding how the 'globePath' line of code is searching for this image. Please help me out. Thanks.
@DannyBentley7 жыл бұрын
Hi I've setup my project to copy all the items to my add in folder, but you may have to do this manually on your project. This is where my image is located plus my .dll and .addin C:\Users\danny.bentley\AppData\Roaming\Autodesk\Revit\Addins\2018
@albobball7 жыл бұрын
Thank you for responding, Danny! I am still having issues. I am playing with it and still can't get it to work. I got my .npg file i my addins folder for 2017, as well as my debug folder for the project. I thought I had it set up so all files copied over when I built my code but I still just copied the image manually but I am still getting this error and I am not sure how to fix it. An exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll but was not handled in user code Additional information: Could not find file 'C:\Users\abonilla\AppData\Roaming\Autodesk\Revit\Addins\2017\Pokeball.npg'.
@DannyBentley7 жыл бұрын
this exception is just a null file not found. It's common when the compiler is looking for a file and it can't find it. Double check that the path and file name match. You might also do a break point and a try catch with exemption message to read what might be causing the problem.
@albobball7 жыл бұрын
Took me almost 2 hours to realize that I had typed the extension '.npg' instead of '.png' Got it to work! Thank you so much, your videos are great
@DannyBentley7 жыл бұрын
happy it worked out. This has happened to me several times as well.
@memetbatu6 жыл бұрын
"PushButton button = panel.AddItem " gives an error "RibbonPanel does not contain definition.." why ?
@DannyBentley6 жыл бұрын
I would check that "MyTest.Command" is what your project name is example "projectname.Command" also the Command is the name of my class which runs the IExternalCommand. Also check to make sure your ribbon is initiated.
@lgsevero6 жыл бұрын
Hi, nice work. How I set up multiple "RibbonPanel's": like Eletrical, AC, Arch ...
@DannyBentley6 жыл бұрын
Hi Lucas, This is great means you have lots of addins. yes just try something like this. RibbonPanel panelMEP = a.CreateRibbonPanel(tab , "testMEP"); RibbonPanel panelAC = a.CreateRibbonPanel(tab , "testAC"); Most of the time projects are created for each individual add-in just test to see if the panel exist and if it doesn't create it. So see if testMEP is added if not it creates it. //*****************************ribbonPanel()***************************** public RibbonPanel ribbonPanel(UIControlledApplication a) { string tab = "By Danny Bentley"; // Tab name // Empty ribbon panel RibbonPanel ribbonPanel = null; // Try to create ribbon tab. try { a.CreateRibbonTab(tab); } catch { } // Try to create ribbon panel. try { RibbonPanel panelMEP = a.CreateRibbonPanel(tab , "testMEP"); } catch { } // Search existing tab for your panel. List panels = a.GetRibbonPanels(tab); foreach(RibbonPanel p in panels) { if (p.Name == "test") { ribbonPanel = p; } } //return panel return ribbonPanel; }
@nicholasjacobson56187 жыл бұрын
Hey thanks for the tutorial. I'm getting a weird warning message... any help would be appreciated. There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "RevitAPI", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.
@DannyBentley7 жыл бұрын
Nicholas Jacobson check your framework to be .NET 4.5 or higher. It’s in the properties. I think the XAML library need this new .NET
@nicholasjacobson56187 жыл бұрын
What solved this was actually changing the platform target from all computers to x64. All seems well but still getting one error on loading to revit. Says Mytest.app cannot be located. Wonder if in trying to change names this got screwed up. Can you explain how the mytest.app is created and used?
@DannyBentley7 жыл бұрын
Great to hear. Check the .addin file and see if the mytest.dll. Also check App.cs PushButton alignViewportToCell_Button = alignViewsPanel.AddItem(new PushButtonData ("Translation", "mytest", thisAssemblyPath, "mytest.Command")) as PushButton;
@nicholasjacobson56187 жыл бұрын
it appears that the namespace 'name' and name.app' just need to be consistent.
@nicholasjacobson56187 жыл бұрын
ah yes good catch. Thanks. Last question... can you point me to where I can load the button with my custom script? Maybe I missed this part but still unsure how a script gets attached.
@jacoblong55536 жыл бұрын
Great videos man, But PLEASE hold control and move your mouse wheel. ZOOOOOOOOOOOOOOOOOOOOOOOOOOOOM in Lol so hard to see.
@DannyBentley6 жыл бұрын
Jacob Long these are my first attempts to make videos so I was still trying to figure out how to use my Mac and recorder. Other videos have larger font
@nvalet5 жыл бұрын
Thank you!
@IknowRicky3 жыл бұрын
the text is so small i can't read anything
@HatStand10007 жыл бұрын
Nice tutorial - just can't read any of the text you're writing...
@DannyBentley7 жыл бұрын
Hi Kevin, You're correct these are my first videos and the font size is small, but here is the source code on my github. github.com/dannysbentley/MyTest The App.cs is where Revit add the tab and button github.com/dannysbentley/MyTest/blob/master/App.cs Best of luck.
@HatStand10007 жыл бұрын
Perfect - thanks. Do you have a version with the icons embedded in the DLL?
@DannyBentley7 жыл бұрын
The icon is on my git. github.com/dannysbentley/MyTest/blob/master/LACMA%20DOORS.png You can add it to the Debug and in your addin folder.