Quantcast
Channel: All Revit API Forum posts
Viewing all 67020 articles
Browse latest View live

Re: Retrieve solids from IFC

$
0
0

:-)

 

Sounds like good fun...

 

Cheers,

 

Jeremy

 


Re: Loading Family into another Family and saving

$
0
0

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

 

Re: press.key method - keyboard shortcut problems in Revit 2019 · Issue #8

$
0
0

I think that people will be more liable to help if you describe the complete problem from scratch.

 

Succinctly explain:

 

  • The task you are attempting to achieve.
  • How it was solved in the past.
  • How it is failing in Revit 2019.

 

Otherwise, nobody will understand what you are talking about.

 

Thank you!

 

Cheers,

 

Jeremy

 

Re: Advice on debugging C# in Visual Studio

$
0
0

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. 

 

22.JPGDebugging Settings

Re: Failed to Initialize Add-In Cannot be found in assembly

$
0
0

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!   

Re: How to batch filter all elements in current view by their built in category

$
0
0

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 + ")"); } }

 

Keep track of element editings or element edited event in Revit 2018/ 2019

$
0
0

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.

Re: Keep track of element editings or element edited event in Revit 2018/ 2019


Re: My First Plugin Revit Model

$
0
0

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.

Re: My First Plugin Revit Model

Re: browsing model files in the cloud (A360 C4R)

$
0
0

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!


Re: Save Group to Library

$
0
0

We would like to access the 'Save Group' command through the api. Is it possible in 2018/2019?

Re: Loading Family into another Family and saving

$
0
0

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."

 

Re: Closing UIView Crashes Revit 2019

$
0
0

Revit 2019.1 Update fixes this issue.  Thanks!

Re: Open Print Dialog via API

$
0
0

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?

 

Untitled.png


Re: Open Print Dialog via API

$
0
0

How about PostCommand() method?

Re: Open Print Dialog via API

$
0
0

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.

Re: Advice on debugging C# in Visual Studio

$
0
0

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! 

 

 

1.JPGManifest File

Error - The debugger's worker process (msvsmon.exe) unexpectedly exited.

$
0
0

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!

How to move cursor othographically?

Viewing all 67020 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>