02 - Revit API - Plugin Essentials - Manage image resources and multiple project setup

  Рет қаралды 10,498

Marko Koljancic

Marko Koljancic

Күн бұрын

This time we create multiple projects setup to better manage our code when it grows. Resource assembly now contains images and there is no need to reference images directly from some folder like we did in previous video. Also core and ui projects added to separate logic as much as possible from ui specific elements and tasks. Core will contain commands and "business" logic and ui all related to embedded dock-able windows and buttons. Hope this small demonstration is helpful, more video coming. Comment if some parts are not clear so I can clear it up for you.
Series playlist: • 01 - Revit API - Plugi...
LinkedIn article on subject:
/ 02-revit-api-plugin-es...
Project repository can found at link bellow.
bitbucket.org/...
Trello roadmap:
trello.com/b/J...

Пікірлер: 17
@ТимурАзизов-ц9д
@ТимурАзизов-ц9д 3 жыл бұрын
Hey! Thank You for incredible tutorials! These videos helped me a lot in understanding of a complexity of the process. Kepp doing great things and improve the community!
@luanbregunce
@luanbregunce 3 жыл бұрын
Thank you for putting out these tutorials Marko, that's unbelievably good. It's very kind of you providing to us. I sincerely thank you.
@MarkoKoljancic
@MarkoKoljancic 3 жыл бұрын
Thank you, Luan. I am really glad to hear that you find these videos useful and informative. I will soon start recording more. :)
@dotaninbar6620
@dotaninbar6620 5 жыл бұрын
grate tutorials man! relay helpful Thanks allot.
@MarkoKoljancic
@MarkoKoljancic 5 жыл бұрын
Thanks. My pleasure.
@tjugolapp
@tjugolapp 4 жыл бұрын
Again trouble with the images.. Revit says ”Property ’urisource’ or property ’StreamSource’ must be set. As far as i can see the the streamsource Is set.. Not sure How to solve it.. This tutorial is really great btw! I thought the first was great but guess there was more where that came from. Looking forward to the next one! :D
@luanbregunce
@luanbregunce 3 жыл бұрын
Hey man, I was facing the same issue, I was beating my brain out to solve it, but then I realize that it was missing a . on the ResourceImage class, on the line where the variable stream is defined. It's "Image.Icons." instead of "Image.Icons", maybe it's the same error on your case. it's been a long time you've asked it, but it might help someone else.
@raphaelbert8995
@raphaelbert8995 4 жыл бұрын
Hello Marko, I love your tutorials, it help me a lot to understand the Revit API. On this one, I followed your video but I get an error in Visual Studio and when Revit open. In VS it says that : 'Main' does not implement interface member 'IExternalApplication.OnShutdown(UIControlledApplication)' So I have searched on the internet a solution and I have seen that this error occur when VS add this line of code : throw new NotImplementedException(); so to solve it, you need to delete it. But I can't find it in the code… Before public Result OnStartup(UIControlledApplication application) I have well : /// same for Onshutdown. Do you have any idea of where is the problem ? Thank you, :) Raphael
@dmytrod9034
@dmytrod9034 4 жыл бұрын
Hi, man. Thank you for those great videos. I have couple questions. Would be greatfull if you could answer: 1. If I am new to coding and I want to create somewhat similar to Wood Framing Wall external application for revit to cater to my own needs. What would be your advise what to start with to be most effective ?(I have gone through autodesk knowledge 7 basic lessons about revit api and now just following your lessons) 2. Regarding this video : How do you get those "ctor" to become public SetupInterface(){} ? And why my "///" command does not return anything other than ////// ?? and last one : why do I always have warning about mismatch between "MSIL" and "RevitAPI", "AMD64". Thank you a lot.
@MarkoKoljancic
@MarkoKoljancic 4 жыл бұрын
Hi Dmytro. Personally I started learning C# and .NET framework in general. With that knowledge I started digging into Revit API as documentation basis to understand fundamentals of how it is designed to behave and what is possible to do overall. After that start with quick small plugins and gradually progress to more complex ones. ctor is a quick snippet to create constructor. Type ctor and press TAB on keyboard. For documenting code you can install GhostDoc, very handy plugin for Visual Studio. When you install it just type /// and it will automatically docent, class, function, property, interface, enum... Revit is 64 bit application so you should build same dlls. In build properties chose x64 or Any something, sorry forgot name of build presset. It should be fine. Btw chose also right .NET framework for your solution based on Revit version you are targeting. As an example chose .NET 4.8 for building Revit 2021 solutions. For other you can use 4.7.1 or 4.7.2 and you are good to go.
@MarkoKoljancic
@MarkoKoljancic 4 жыл бұрын
Also thank you for kind words. Hope you are going to find this videos/articles useful to get you going. Keep solution organized and gradually progress. Soon I will share link from my dear teamates that suibmited article for this years Autodesk University on subject of Revit API, modeless dialogs, WPF and external event mechanisms. They are experts in Revit API. ;)
@dmytrod9034
@dmytrod9034 4 жыл бұрын
@@MarkoKoljancic Thank you again for such a comprehensive answer. And the link you are about to share will be of great help as well. Thank you kindly.
@TheNillesen
@TheNillesen 5 жыл бұрын
hi dude, i followed your video and even doubble checked with your code in the bitbucket repo. I get an error when i open Revit it goes like this: System.InvalidOperationException System.InvalidOperationException : Proberty 'UriSource' or property 'StreamSource' must be set. at System.Windows.Media.Imaging.BitmapImage.EndInit() at cbb.res.ResourceImage.GetIcon(String name) at cbb.ui.RevitPushButton.Create(RevitPushButtonDataModel data) at cbb.SetupInterface.Initialize(UIControlledApplication app) at cbb.Main.OnStartup(UIControlledApplication application) my guess is that is has something to do with the images not being loaded correctly but i dont know what to do differently. hope you can help
@TheNillesen
@TheNillesen 5 жыл бұрын
I got it to work by changing this code : //var stream = ResourceAssembly.GetAssembly().GetManifestResourceStream(ResourceAssembly.GetNamespace() + "Images.Icons." + name); with this code: //Assembly asm = Assembly.GetExecutingAssembly(); //Stream stream = asm.GetManifestResourceStream(asm.GetManifestResourceNames().First(o => o.Contains(name))); so is it because i didnt implement the WPF correctly?
@MarkoKoljancic
@MarkoKoljancic 5 жыл бұрын
@@TheNillesen Cool, you managed to fix it by yourself. Your code will work as I see. This error indicates that Revit has problem with finding image at plugin loading stage, nothing to do with wpf or implementation of dockable pane. Can you please check if your image has checked Embedded Resource option when you loaded it in resource assembly/.dll. My idea is to have all resources fonts, images,.. in one .dll so that plugin depends only on that assembly not on external files. Code should work it is pretty much straight forward. Thumbs up for your version. :)
@chriskrieps
@chriskrieps 4 жыл бұрын
@@TheNillesen Thanks for posting, this worked for me as well! I tried Marko's tip for ensuring Embedded Resource is checked, but was still failing to load.
Create a REVIT Plugin from SCRATCH using C#
31:57
ProArchitect
Рет қаралды 11 М.
Самое неинтересное видео
00:32
Miracle
Рет қаралды 2,7 МЛН
Men Vs Women Survive The Wilderness For $500,000
31:48
MrBeast
Рет қаралды 101 МЛН
Running With Bigger And Bigger Lunchlys
00:18
MrBeast
Рет қаралды 19 МЛН
💩Поу и Поулина ☠️МОЧАТ 😖Хмурых Тварей?!
00:34
Ной Анимация
Рет қаралды 1,6 МЛН
No, Einstein Didn’t Solve the Biggest Problem in Physics
8:04
Sabine Hossenfelder
Рет қаралды 295 М.
06 - Revit API - Family Manager Plugin - Dockable Pane, Revit and WPF
35:57
Molly: A More Secure Signal
8:05
Techlore
Рет қаралды 18 М.
Revit Lookup For Beginners [Revit API Tutorial]
10:15
Erik Frits
Рет қаралды 6 М.
Dynamo Shorts - Ep002 - Numbering Elements
34:21
DanamoBIM
Рет қаралды 12 М.
01 - Revit API - Plugin Essentials - First steps, basic plugin setup
24:03
New tab & buttons in Revit, using the Revit API
16:18
VA for BIM tutorials
Рет қаралды 10 М.
Самое неинтересное видео
00:32
Miracle
Рет қаралды 2,7 МЛН