Massive help. I have been using CAD/BIM for a few years now and are heading into the new world of coding. Your videos have been a massive help.
@jlumley5 жыл бұрын
Good to hear. It takes a bit of production I have a new appreciation of youtubers.
@dgshen5 жыл бұрын
Big thanks, Joshua. Great help in my rather young Revit API developer experience. One thing I found out after installing this tutorial API is that if there's an Add-in using older version of Xceed.Wpf.Toolkit in your Revit system. It will throw an error message " Set connectionId threw an exception ' Line number '10' and line position '10' after pushing the 'Properties Grid' button. After disabling that particular Add-in, it will work just as expected.
@jlumley5 жыл бұрын
Thank you I didn't know this. I wonder if it is possible to load both old and new ToolKits in parallel?
@dgshen5 жыл бұрын
@@jlumley I hope so. Someone had post a thread on stackoverflow about this. Maybe it is possible. stackoverflow.com/questions/34802007/using-two-different-versions-of-same-the-nuget-package devnet.kentico.com/articles/referencing-multiple-versions-of-the-same-assembly-in-a-single-application
@jlumley5 жыл бұрын
I've solved this problem now (new links in video description). It wasn't an older version but the same version loaded twice, now it checks that it is not already loaded (per version) before loading.
@davidbigras10125 жыл бұрын
Wow I was too fast on my comment, I messed up the installation. I did a repair on the installation and everything works fine. Thanks again for your videos.
@jlumley5 жыл бұрын
Good job.
@kongpadintharayota91974 жыл бұрын
Hi Joshua Your Hero. Wait you secrets part3
@blasiomuhinda59132 жыл бұрын
Thanks. Really benefited alot from this video and now understand clearly how to make installation files. Used your information to the very end and it worked perfectly for me with some little twicking. Thank a lot!!
@67Keldar4 жыл бұрын
Hi Joshua, Love the videos... I saw you recently on the DBEI "Kick-start Revit Plugin Development, 19 coding techniques" presentations. then found these videos on here. I love the shortcut you've discovered for switching into developer mode and how you can iterate rapidly between iterations, I'm not sure I fully understand exactly how that is working yet, but I'm working on it. Thanks for sharing and I'd love to see more... maybe just focusing on the Developer Mode functionality in more detail...?
@jlumley4 жыл бұрын
Thank you for the kind words. I will do this but need to figure out how to put it into words...I'll fit it in over the next day or two.
@jlumley4 жыл бұрын
Hi Mr James, This is best how I would describe the Developer Mode functionality. When the dropdown is set to 'Development', it runs IExternalCommand code that is different from 'Release' code. This code loads assemblies from 'AddIn' (or debug) directory instead of assemblies from the directories in Program Files. Then once the 'AddIn' assembly is loaded a particular method of a particular class in that assembly is ran. The Development Mode IExternalCommand code has three key methods: 1.Assembly.Load(File.ReadAllBytes(, 2.GetTypesSafely( and 3.objType.InvokeMember(. Method 1: Loads the assembly. Method 2: Gets the Types, and loops through them all in a foreach statement. Method 3: On the iteration where the 'if' conditional is met (IsClass is true and the name of the class is correct) the InvokeMember is tiggered and runs a particular method in the class while passing some of the same arguments received by the parent IExternalCommand (commandData & elements). Kind regards, Joshua.
@krilin394 жыл бұрын
Amazing i was trying to learn how to do something like that for a long time !! thanks for sharing!!
@geo94711 ай бұрын
This video is goldmine! Joshua, I have a question regarding the setup project: when adding the primary output of the actual plugin (MyParent and MyChild in your video), VS adds bunch of DLLs when I only need one for my add-in to function. Are these DLLs really needed?
@jlumley11 ай бұрын
No they're not needed and can't be used anyway unless they're loaded individually. They never bothered me much because the files are small. If your using something like 'Advanced Installer' to make your MSI then you can be more effectively selective on what stays in.
@kai-striega5 жыл бұрын
Hi Joshua. Thanks for your videos I'm finding them extremely useful! I did come across an issue while trying to compile myParent. I was able to fix it by removing the redundant "}" on line 135 in "015 Drag On Class2 the Invokes.cs"
@jlumley5 жыл бұрын
Thank you I fixed it, it wasn't the } but a missing if statement at line 173.
@kai-striega5 жыл бұрын
I think I'm missing something here, could you explain to me how you arrived at a missing if statement? When I try to compile the (unmodified) file the first error message I receive is "C:\ProgramData\Autodesk\Revit\Macros\2020\Revit\AppHookup\myParent\Source\myParent\015 Drag On Class2 the Invokes.cs(135,17,135,18): error CS1524: Expected catch or finally". As far as I can tell, this occurs as the "}" closes the try statement excluding the code that should have been in the try clause. I don't intend to be difficult but I don't have a C# background (usually Python + C/C++/FORTRAN) so I'm trying to clear up anything I don't understand before it becomes a problem.
@jlumley5 жыл бұрын
@@kai-striega The code in the new download link works, I just tested it again just now to double check. The structure of try catch and finally always looks like the below. And yes code should run within the try's curvy braces. try { } #region catch and finally catch (Exception ex) { } finally { } #endregion
@adolforodriguez77525 жыл бұрын
Thanks Joshua!!! Excellent tutorial!!! Just a question: If I do any change (update) in the code... How ProductVersion could be changed? i.e. from 1.0.0 to 1.0.1? manually is enough.
@jlumley5 жыл бұрын
...and click 'Yes' when it recommends to change the ProductCode that is all you need to do.
@adolforodriguez77525 жыл бұрын
@@jlumley Ooooh thanks! Just a change in properties of "Revit API NuGet Example 2019"... ProductCode updates automatically!... Sorry about this obvious question and thanks again!
@hazemelamir20834 жыл бұрын
Very very good You are awesome Many thanks
@B1MPro5 жыл бұрын
You're my personal Jesus Christ man! keep those videos coming : )
@bimgarden5 жыл бұрын
many thanks, your video is the best
@jlumley5 жыл бұрын
Thank you, the All Blacks just lost the semi final this comment has cheered me up.
@Bettadodeyavijayavittala Жыл бұрын
Hi Mr. Joshua, Im a precast concrete design engineer and now am working in Revit for modelling precast concrete memebers. Is there any chance we can add connection to these members? cz i came across this vidoe where the connections were provided at simple click. i know it is not how easy as it seems. but i would like to know the approach Thank you :)
@michaelblanchette88595 жыл бұрын
Been watching these 2 videos as I try to get introduced to coding in Revit (and coding altogether) and have already had so many questions answered. I am curious about how far one can go with coding in Revit. Is it possible to create an add-in for modelling custom families? Similar to the simplistic way that Revit lets you model walls, pipes, or ducts.
@jlumley5 жыл бұрын
Your welcome. For a family that is parameter driven with shared parameters making a new types with different values it is very easy indeed. But if you mean creating family geometry from scratch and modelling geometries with code then that is difficult.
@jlumley5 жыл бұрын
However pipes and ducts are system families which can't be family edited. 'PIpe Fittings' and 'Duct fittings' can be family edited.
@lokeshv75753 жыл бұрын
Good job
@chinano63065 жыл бұрын
Thank you from Korea
@jlumley5 жыл бұрын
Cheers, K-pop is my guilty pleasure.
@JASONMHOLDEN5 жыл бұрын
Awesome. Thank you so much Joshua. I have done a few single take items myself so I know how difficult it is. You have done an amazing thing.
@jlumley5 жыл бұрын
Yes it takes a few takes to get right. The reason I do it is because often with instructional videos and blogs on advanced topics assumes 'common knowledge' which jumps several steps. With continuous take you literally see everything and can replay the bits you’re stuck on.
@JASONMHOLDEN5 жыл бұрын
@@jlumley I have watched both videos at least three times. Who knows how many rewinds and replays happened in the midst. Is it possible to step into code being called from revit events? I am currently inserting TaskDialogs to track down where things are going astray. Will be great if there is an easier way.
@jlumley5 жыл бұрын
@jason holden The short answer is no it is not possible or at least I have never discovered an efficient technique to do it. This is offset by the fact plugin dll files are small and take no time to build & test. What your doing with TaskDialogs (or Messagebox) is also the way I do it.
@JASONMHOLDEN5 жыл бұрын
@@jlumley I have recently had some success with attaching VS to an open Revit instance. I found if i stop debugging it may close Revit also but detach from all process doesn't for some reason. This method seems to work best when Sharp Develop is also open. It is a bit hit and miss the first time but once attached properly i have found the reattach to process option seems to work fairly consistently. I hope this works for you also.
@JASONMHOLDEN5 жыл бұрын
@@jlumley I am also wondering if there are limitations to this method. All works as expected for the form. I have added a couple of buttons which work properly from installer file but when I switch to developer mode and modify the code nothing seems to happen. The only change I have made is to comment out a call to TaskDialogue.Show. Can you offer any insights?
@LesterMolinaCartuchoDesigns5 жыл бұрын
Hi Joshua. Thanks so much for sharing your great work. I really appreciate it. Question. I was following this video step by step until I could not find the "Property Grid" in my Toolbox. Actually, I could not find any of the tools you show in your toolbox with prefix . I was reading online and couldn't arrive to a conclusion. Would you please shade some light? Again, thanks a lot for your great work and share!
@jlumley5 жыл бұрын
In toolbox: right mouse click 'Choose items...', in WPF Components tab click 'Browse', with your project files there will be a subdirectory 'packages\Extended.Wpf.Toolkit.3.5.0\lib et40' navitage there and choose Xceed.Wpf.Toolkit.dll file and click Open. Make sure PropertyGrid controls are selected and click OK. You can now drag drag in Properties Grid from toolbox.
@jlumley5 жыл бұрын
I made a video: kzbin.info/www/bejne/kKq5loeFaKaaiJo
@LesterMolinaCartuchoDesigns5 жыл бұрын
@@jlumley I saw the video before your reply. Excelent!!! It worked. Now... I had another issue by following your video. Built myChild1 (minute 28:13) and got errors on lines 73, 74, 76 in Window1.xaml.cs. CS0103 The name 'myPG' does not exist in the current context. I really appreciate your time and effort on taking care of my questions. Thanks.
@jlumley5 жыл бұрын
The Properties Grid needs a name. Name it 'myPG', you can do that near the top of the properties window in visual studio.
@LesterMolinaCartuchoDesigns5 жыл бұрын
@@jlumley You're absolutely right! Moving on with your video. Thaaaaankkks a lot!
@karstenmurning93532 жыл бұрын
Hi Joshua, Very nice to see you videos. I have coded C++ earlyer and want to go into C# coding for Revit. So it's nice to see you videos and i hope I will make you videos work. But my first problem is that i have 3 project myParent, myChild, WPFlibrary and i need the fourth (4) with adding a "new Project". But I can't find the setup-template. Can you tell me what I'm doing wrong or missing? Regards Karsten
@jlumley2 жыл бұрын
Create a new project with Class Library (.NET Framework). Revit project templates are available (probably on git hub) but I don't use them because I personally enjoy manually setting them up.
@karstenmurning93532 жыл бұрын
I Can not find the .net framework. Is it the same as wpf class? I am using visual studio 2022
@jlumley2 жыл бұрын
@@karstenmurning9353 Run the visual studio installer again with the correct options selected.
@karstenmurning93532 жыл бұрын
@@jlumley Now the .net framwork wroks. But the final project is the setup template. But it can not find it. Can you tell what i am doing wrong ?
@jlumley2 жыл бұрын
@@karstenmurning9353 I have no idea, keep trying.
@davidbigras10125 жыл бұрын
Hi Joshua! Thanks for your video, really great work. Also it seems that I have an install problem. The code detects another application already installed and won't install. I looked in the installation code to see what was installed and everything is gone including the registry key. But the program is sitll listed in the "Program and Feature list". What trace could be left? Thank you.
@jlumley4 жыл бұрын
Try uninstalling from the Program and Feature list. Sorry for the lateness of this reply, this comment got caught in the 'Likely spam' filter for what reason I have no idea.
@yafimski3 жыл бұрын
Hi, installed and working (my own code but followed your video). I didn't install the NuGet packages you did because I don't need them in my project. but there seems to be a problem when uninstalling: "Error 1001. ... Cannot delete a subkey tree because the subkey does not exist." Can this be related to some line in the install-uninstall snippet you provide? Thanks
@jlumley3 жыл бұрын
Yes it will be in the Uninstall method of ClassLibrary_CustomActions.
@yafimski3 жыл бұрын
@@jlumley Followup question - I'm encountering an "Error 1001. Exception occurred while initializing the installation: System.BadImageFormatException: Could not load file or assembly 'file: ///[some path and file .dll] or one of its dependencies." - from searching a solution it looks related to the .Net Framework Launch Condition. I set it to 4.8, as well as the myParent and myChild porjects are 4.8, while myProject is x64 and myChild is x86. I tried changing it to x64, or 'Any CPU', or downgrading everything to 4.7.2, but nothing worked. Have you come across this? Thanks
@jlumley3 жыл бұрын
@@yafimski This is happening because dependent assemblies are not being loaded. This is API programming assemblies are loaded into the Revit.exe process with code...it is not automatic.
@yafimski3 жыл бұрын
@@jlumley The issue in the end was that I tried to be clever and merge the installer inside myParent, but now when I've seperated it out to ClassLibrary1, it worked :) thanks!
@jlumley3 жыл бұрын
@@yafimski well done
@TTillahFK5 жыл бұрын
"2 mio, probably most downloaded" *RestSharp and Newtonsoft.JSON laughing in the background*
@houba12632 жыл бұрын
Sir i have a plugin that works on revit 2020 how to make an installer so that it makes it work on revit 2021
@jlumley2 жыл бұрын
Copy the addin file into all the years (which will be the directories found here): Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\Autodesk\\Revit\\Addins";
@houba12632 жыл бұрын
Hello again , i want to create a license for my installer (so it s a pay to get the installer ) what are ur suggestions and thank you .
@jlumley2 жыл бұрын
I'm not the person to ask sorry. Because it installs like a regular program there is no doubt there are extensive threads on this topic at stackoverflow.
@maxsun60995 жыл бұрын
Very useful content, huge thanks to you! I have followed your video till the end, it was clear and the project compiled without an error. However after successful installation, when I open up revit and try to use it, an "External Tool Failure" window shows up and displays the following message: "" Revit cannot run the external application "myParent". Contack the provider for assistance. System.NullReferenceException System.NullReferenceException: Object reference not set to an instance of an object. at myParent.ThisApplication.OnStartup(UIControlledApplication a) at Autodest.Revit.UI.RevitManagedAppStartupAgency.RevitManagedAppstartUpControlledApplication, Astring* assemblyName, Astring* className, Astring* exceptionName, Astring* exceptionMessage) "" the same message shows up when I installed the .msi file you provided. Any help would be much appreciated and thanks for producing this video!
@jlumley5 жыл бұрын
Thank you I have reproduced the error on my home machine. I'm fairly sure it is a simple fix but will need a day.
@jlumley5 жыл бұрын
It has now been fixed and the download updated. (The bug was on the OnStartup method in '020 onstartup and shutdown'.) Please tell me if it works now.
@maxsun60995 жыл бұрын
@@jlumley Thank you for the update. However, I have changed the code in '020 onstartup and shutdown'. Uninstall and installed previous packages. Revit still gives the same error message. The size of installation packages 'Revit API NuGet Example 2019' is significantly different, 10464KB (provided by you in the dropbox download) and 6220KB ( Generated on my machine using your codes). Could this be the problem?
@jlumley5 жыл бұрын
Can I see your design files, do you have dropbox?
@maxsun60995 жыл бұрын
@@jlumley Yes I have dropbox, how should I upload the files?
@amritbanerjee3 жыл бұрын
Could you create a similar tutorial for Navisworks Please. and just a tip, you could use Davinci Resolve to edit the video so that you don't have to do it all in one take.... Btw can't thankyou enough for all the information within this video Edit : Forgot to mention Davinici Resolve is free to use and is a industry standard editing tool comparable to Adobe Premiere or Final Cut Pro
@alirzaylmaz96934 жыл бұрын
I have a problem with creating macros. I cant click on the macro button after creating module. I try to solve this problem 2 week but ı cant do it. Can you help me to understand findin the problems reason.
@jlumley4 жыл бұрын
2 weeks makes you persistent well done. Can you elaborate on what you mean by 'macro button' and at exactly what stage.
@alirzaylmaz96934 жыл бұрын
@@jlumley My revit 2020 can't load macros when i create module. Program shows me this " help.autodesk.com/view/RVT/2020/ENU/?guid=GUID-071913D8-214A-45AB-A798-A81653E77F88 " , " Loading the macro failed. Rebuilding the module may resolve this issue." icon every time. I cant solve this problem. I watched your all videos and repeated your every commands. I think i cant do it succesfully as long as i cant solve this problem. Thanks already.
@jlumley4 жыл бұрын
Delete C:\ProgramData\Autodesk\Revit\Macros\2020\Revit\AppHookup completely if the data contained if not precious (make a backup first).
@alirzaylmaz96934 жыл бұрын
@@jlumley I try that now but didnt work. Revit shows me that failed icon again .
@jlumley4 жыл бұрын
Do you have full administration privileges to your PC? And Check under Optinos -> Macros -> Application macro security settings that Enable application macros is selected.
@narrsam4 жыл бұрын
Thanks for sharing Joshua, and keep up the good work!. Some pointers and questions: 1- I appreciate that you're respecting the viewer's time and preparing those code snippets, but going over the critical parts of the code would be much more helpful especially that this is not a typical approach to creating a Revit plugin. I understand that this might extend the time of the video so why not turn it into a series? 2- I tried downloading the dropbox shared folder but I only found the SharpDevelop projects there, it would be great if you can share the whole solution for a complete picture. 3- Do you think you can implement a MVVM pattern into this workflow? 4- And finally, why do you insist on making the video in one take? Edit you videos and cut the mistakes out! It will save you time to make more great ones :)
@jlumley4 жыл бұрын
Thank you for your feedback I will do my best to answer. No.1: Yes sir. I am doing that very thing as we speak. It is going to be called 'Revit’s c# Playpen - 23 Code Tricks & Hidden Commands'. No.2: IDE files are not proprietary. *.sln and *.csproj are BOTH Sharp Develop & Visual studio. What you downloaded is indeed to be opened in visual studio. They were 'created' in sharp develop...which is the one thing sharp develop is good for. Then they were migrated to visual studio simply by opening them. It is all in the video. No.3: I'm not storing data separate to a database or file, except for the 'settings', all other data gets destroyed as soon as the user closes the window. This is a plugin not a standalone application and the added complexity of MVVM hasn’t been worth it so far. But yes, I will probably use it in the future at some point. No.4: There are not that many mistakes are there? Doing videos in a single take is very deliberate because this way nothing gets missed. My biggest frustration with online tutorials is when the teacher goes from step 6 to step 7 when there were in fact several steps between 6 & 7 which were skipped because the teacher 'assumed' the student already had this knowledge. The assumption is bad. I really appreciate these questions; they are making me think. Keep them coming.
@narrsam4 жыл бұрын
@@jlumley Thank you for the swift reply and all is fair enough :) There are no mistakes but I'm just greedy, if you make videos faster, I would get more of them :p Really great content and please keep it coming...
@coenooijevaar40584 жыл бұрын
Hi Joshua, Thanks for this video. its really amazing and its learning me all sorts of things. i thought i was going through this tutorial without having any questions until i stumbled upon adding project output mychild in the setup project. if im looking at your video hes adding, lets say, 3 assemblys/output or so. in my setup project hes addin tons. for example: essentailsdbapi.dl hostobjdbapi.dll curtaingridfamilydbapi.dll sitedbapi.dll looks like all revit related stuff, but i cant figure out why he is adding those, you got any idea ?
@jlumley4 жыл бұрын
Is it possible to provide a screenshot. I can't tell based on your description if this is normal or not.
@coenooijevaar40584 жыл бұрын
@@jlumley i dont think this is possible in youtube comments. is there any other way i could send you the screenshot? facebook?
@jlumley4 жыл бұрын
You can post a link here like this drive.google.com/open?id=1gH056dJNKRhYAn7hsCQB_MCJRXXStHtA