:-)
Sounds like good fun...
Cheers,
Jeremy
:-)
Sounds like good fun...
Cheers,
Jeremy
Close ALL other documents.
It sounds to me as if you have a document open that contains a reference to the family you are trying to modify, blocking the modification.
Maybe all loaded families are read-only.
Cheers,
Jeremy
I think that people will be more liable to help if you describe the complete problem from scratch.
Succinctly explain:
Otherwise, nobody will understand what you are talking about.
Thank you!
Cheers,
Jeremy
Hi Mustafa,
Yes I did as shown in the screenshot below. Let me know when we can have a quick goto to look at this. And then I will post what we find here afterwards.
Debugging Settings
Disabled by Windows, that was the trick. I spent 30 minutes that morning re-bundling a macro to create an add-in, then the rest of the day confused as to why it wasn't working, trying re-writing several of the walkthroughs all with the same result, trying the walkthroughs on another computer.... Just read your solution and had my original add-in working 5 minutes later. Thanks so much!
A FilteredElementCollector isn't a static set of Elements. After applying a filter the collector only contains the elements that pass the filter.
I suggets you use LINQ to order the collector into a dictionary:
// using System.Linq;
Dictionary<ElementId, List<Element>> allcateDict = new FilteredElementCollector(document,currentview.Id) .Where(elem=> elem.Category!=null) .GroupBy(elem=>elem.Category.Id ) .ToDictionary(x => x.Key, x=> x.ToList()); // Iterate through all list of each category, if their count > 0, add to the listbox in the winform foreach (var item in allcateDict) { if(item.Value.Count>0) { listBox_Category.Items.Add(item.Value.FirstOrDefault().Category.Name + " (" + item.Value.Count + ")"); } }
I am working on a project that rebars to host elements in Revit 2018 and Revit 2019. After my code regenerate the rebar reinforcement for the host element, I can not know if user have manually edit my host or my rebars (generated by my code, of course). I just come up with these 2 ideas:
1. Store all rebar and host info into the host 's extensible storage (literally every properties, ids, ….) at the time the rebars are generated by my code. When I call my code to work on the host again, I am going to compare all the current info with the saved info in the host 's entity to find out what has been changed.
Clearly this approach is going to cost me a lot and has a huge penalty on performance.
2. Catch all the change the user might do to my rebars and hosts through an "Element - edited - event". However, I can't seem to find the right event that suits my need. I 've tried Element and Document events and ITransactionFinalizer class without results.
Where can I find the event I want or how to achieve what I wanted? Another and better approach is much welcome. Thank you all in advance.
Just found a very interesting approach here:
https://thebuildingcoder.typepad.com/blog/2016/01/tracking-element-modification.html
I need time to try this out, but just incase any one encounter the same problem.
Thanks for your help.
I have my own Revit files I can use, but I would assume that with a tutorial on programming that the .rvt files required to test/use the code in the examples would be provided under the section that you are working on.
As these are programming tutorials I would usually like to use actual provided .rvt files incase any settings/items required to execute the code correctly are missing.
As these are introductory lessons on C# programming it would be good for Autodesk to place the required files within the 'lesson 1 download folder'.
Thanks for the example file.
Thanks for the info.
Thanks for your sharing
I tested this code but I just get projects on BIM team not BIM 360.
var cloudProjects = CollaborateUtils.GetCloudProjects(RevitUIApp.ActiveUIDocument.Document);
So, is this code possible with BIM 360?
Thanks for your support!
We would like to access the 'Save Group' command through the api. Is it possible in 2018/2019?
I realize the possibility that for every family path I open, when the if condition is met I try to load a nested family back into that parent family, that this is where the conflict may exist. So I tried adding familyDoc.Close() right after the if statement to close the parent family I was querying but now I get a new exception.
"The referenced object is not valid, possibly because it has been deleted from the database, or its creation was undone."
Revit 2019.1 Update fixes this issue. Thanks!
Hey
I figured out the transaction issue, and that's all well and good. The PrintManager is printing the views, which would be fine if that's what I needed. Unfortunately, it is not. I need to open the Print dialog so that users can specify their print settings. The PrintManager.SubmitPrint() just essentially does the same thing as View.Print(), which is what I'm trying to get away from.
Am I missing something?
How about PostCommand() method?
I don't see how that could provide any different results, but maybe I'm not understanding this fully... Is the PrintManager class supposed to open the dialog, or just print a selection of views? Because it seems to me that the latter is the case.
Mustafa is so helpful during the goto meeting and found the issue in the manifest file. On Line 19 below, we changed 34 to any random 2 digits (0-9, a-f). The original AddInId was conflicting with an existing .addin file. After changing 34 to 66, the debugging yellow arrow pops up.
Mustafa is a magician! Cheers!
Manifest File
The debugger's worker process (msvsmon.exe) unexpectedly exited. Debugging will be aborted.
I'm getting this error ever time I debug. I started after I set the Target Framework to .NET framework 4.7. It happens when the code hits a break point. No break point, no error, unfortunately I need break points when debugging of course.
Anyone experienced this? Thanks!