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

Re: ElementIntersectsElementFilter with linked docs

$
0
0

Hi Sanjay,

 

How exactly did you make it to work? I'm in a similar situation and for me it is not working.

I have an element from a linked doc and another one from current doc and ElementIntersectsElementFilter fail to see the intersaction.

 

This is what I'm doing:

 

FilteredElementCollector collector = new FilteredElementCollector(element.Document, new List<ElementId> { element.Id });
collector.WherePasses(new ElementIntersectsElementFilter(elementFromLink));

 

and collector.GetElementCount() return 0

 

Thank you,

Claudiu

 

 


revitapi add color scheme

$
0
0

How to add color scheme to the room?

Thanks for your help!

Re: ElementIntersectsElementFilter with linked docs

$
0
0

Here it goes:

foreach (Document linkedDoc in doc.Application.Documents)
                {
                    FilteredElementCollector collectorn = new FilteredElementCollector(linkedDoc);
                    collectorn.WherePasses(new ElementMulticategoryFilter(builtInCats));
                    ElementIntersectsElementFilter testElementIntersectsElementFilter = new ElementIntersectsElementFilter(intersect);
                    collectorn.WherePasses(testElementIntersectsElementFilter);
                    foreach (Element elm in collectorn)
                    {
                        //string gt = elm.Id.ToString();
                        //TaskDialog.Show("IIPL", gt + "source " + intersect.Id.ToString());
                        got = true;
                        break;
                    }
                    if (got == true)
                    {
                        break;
                    }
                }

Thanks & Regards

Sanjay Pandey

Re: Problem with parameter value change

$
0
0

Hi,

 

Try to run the loop in try catch block and run the code in debug mode so as to know the cause.

 

Thanks & Regards

Sanjay Pandey

Parametric angle, radius and number properties of radial array using API

$
0
0

Hi guys,

 

I'm developing an plugin for Revit which generates a family file. This family contains an extrusion geometry and a radial array of that geometry. The idea behind this is that the user can open the RFA and through the parameter window can manipulate the angle, number of columns and the radius of the radial array. 

 

So I followed the Alfredo Medina's example:

http://planta1.com/blog/controlling-the-3-properties-of-a-radial-array-angle-number-of-items-and-radius/

 

I would like to do it programmatically, because the geometry, that have to be repeated, could change depending on some customer requirements. For instance, it could be an extrusion (boxes, cilinder), revolve, family instance...

This way the user can create catalog types of that family.

 

Is it possible to constraint programmatically the angle and radius of the array as Alfredo did manually?

 

Thanks in advance

printManager.SubmitPrint() issue

$
0
0

Hi, 

I have a question in Revit. 

When I tried to print multiple sheets in Revit as PDF using C# Revit API,

 

I am getting following  "Save as" dialog and expecting the user to click “Save” button every time. This dialog is we are getting from printManager.SubmitPrint();

Could you please let me know, how can we saved automatically without pop up following dialog.

print to PDF using C# Revit API

$
0
0

I have a question in Revit.

 

When I tried to print multiple sheets in Revit as PDF using C# Revit API,

 

I am getting following  "Save as" dialog and expecting the user to click “Save” button every time. This dialog is we are getting from printManager.SubmitPrint();

Could you please let me know, how can we saved automatically without pop up following dialog.

Re: Why is Element.Location null for perfectly valid FamilyInstance objects?

$
0
0

Got it, thanks!  Ok, so I'm guessing the transform (and the Origin of the transform) are always non-null.
But I guess to robustly get the "location" of the door with some consistent definition of "location" such as "at the floor level, in the center of the door when closed", I will need to use geometry.

 

And yes, sorry about not specifying the particular sample project.  Will do next time!


Re: Parametric angle, radius and number properties of radial array using API

filter view by type (Section, plan, elevation, etc...)

$
0
0

Hi All,

 

I'm looking a way to filter all the views collected in my document. I need to differentiate section views, elevation views, plan views, etc.

 

FilteredElementCollector viewColl =
                new FilteredElementCollector(doc).
                OfClass(typeof(View));

I would like to complete the above code.

 

Any tip of advice will be appreciated.

 

Thanks in advance!

 

 

 

 

Re: filter view by type (Section, plan, elevation, etc...)

$
0
0
ViewType desiredViewType = ViewType.Section // for example
FilteredElementCollector viewColl = new FilteredElementCollector(doc)
.OfClass(typeof(View))
.Where((v) => v.ViewType == desiredViewType);

would work if you want to filter by a specific type of view. If you want to split them by view type,  

FilteredElementCollector viewColl =
                new FilteredElementCollector(doc)
.OfClass(typeof(View))
.GroupBy((v) => v.ViewType);

 will give you an IEnumerable of groups of views where each group has the same type. 

Re: Render Material Texture Image

Re: Insert Family Instance

$
0
0

Dear Jorge Villarroel,

 

Can you clarify your question?  in your latest comment, you mean "...can't figure out how to access the just-created element... ",  do you think the GetAddedElementIds in OnDocumentChanged event can satisfy your requirement? 

 

 

Besides, can you provide a reproducible case for it?


In order to explore this matter further, we will need to provide a minimal reproducible case for the development team to analyse in depth.
In order to understand exactly what you mean and be able to research possible reasons for the discrepancy between the observed and expected behaviour, they require: 
· A short exact description of what you are trying to achieve.
· The behavior you observe versus what you expect, and why this is a problem.
· A complete yet minimal Revit sample model to run a test in.
· A complete yet minimal macro embedded in the sample model or Visual Studio solution with add-in manifest that can be compiled, loaded, run and debugged with a single click to analyse its behavior live in the sample model.
· Detailed step-by-step instructions for reproducing the issue, e.g. which element to pick, what command to launch etc.
· http://thebuildingcoder.typepad.com/blog/about-the-author.html#1b

How to take quantity for rebar both tension and compression separately in a beam

$
0
0

A doubly-reinforcement concrete beam contains reinforcement rebars both in compression (upper location) and tension (lower location). There can exit rebars of different diameter in both locations.

I want to extract the reinforcement quantities separately for both locations and diameters through Revit API (C#). Can anyone please guide me for this? I am using both 2018 and 2019 versions of Revit (student license). Thanks

Re: Parametric angle, radius and number properties of radial array using API

$
0
0

Thanks Jeremy for the quick reply,

 

actually I know how to create Radial Arrays, the problem is how to make parametric the radial array "properties": angle, radius, number. It means, that my plugin will generate a RFA that allows the user to change the angle, radius, and number of copies using the Family types dialog.

 

I have seen that for constraining the number of copies, I have to do something like:

 

Extrusion extrusion = CreateBox(doc);
Autodesk.Revit.DB.View pView = findElement(typeof(ViewPlan), "Ref. Level", doc) as Autodesk.Revit.DB.View; var offset = new XYZ(UnitUtils.ConvertToInternalUnits(-5, DisplayUnitType.DUT_MILLIMETERS), 0, 0); RadialArray radialArray = RadialArray.Create(doc, pView, extrusion.Id, 6, Line.CreateBound(offset, XYZ.BasisZ + offset), 60*Math.PI/180, ArrayAnchorMember.Second); doc.Regenerate();
//parametric number of copies FamilyParameter familyParam = doc.FamilyManager.AddParameter("ArrayElements", BuiltInParameterGroup.PG_CONSTRAINTS, ParameterType.Integer, true); radialArray.Label = familyParam;

 

but, how to constraint using the REVIT API the angle and radius of the Radialarray element?

 

Thanks in advance


Re: Open a file if central model cannot be found

$
0
0

I'm experiencing the same issue in Revit 2017. If the Central file doesn't exist or is inaccessible this exception occurs.

 

Can this exception be handled, as in my instance I'm not interested in whether the central file exists, I'm just trying to detached the local and save it as a new central file.

 

K

Re: delete textnotetype using API

$
0
0

cant find the source of error

$
0
0
Hi everyone. 
I have a problem with my project file. 
 
The situation is:
 
1) I have grouped a whole floor level with it's component.
2) then, when i tried to edit the group, it says 
            'Can't make change to Group "Level 1 a" with more than one instance. To resolve: Ungroup and Group again under a new name. Edit and make change, then change all instances of the original Group to the new Group.'
3) I tried to Ungroup the group, then it says, 'Profile sketch is empty!'
 
so, i cant find which profile sketch is empty. I really dont know what to do. but i cant afford to do the model all over again.
please, if anyone can help me, i am very2 greatful

Revit Drag and Drop in 2018 & 2019

$
0
0

Hi,

 

I'm currently experiencing an issue in Revit(2018, same behaviour in 2018.1 & 2018.3) with drag and drop.

 

API Function that i'm using for the drag and drop:

Autodesk.Revit.UI.UIApplication.DoDragDrop(Object, IDropHandler)

 

Problem:I have created a custom Add-in which works well in Revit version 2014-2017 but in Revit 2018 and 2019 this doesn't seem to work.  I've attached a screenshot which how far i can get but the refit family is never actually dropped into Revit.

 

Any thoughts on what could cause this?

 

Regards,

Re: filter view by type (Section, plan, elevation, etc...)

$
0
0

Thanks a lot ! Just what I was looking for.

 

Regards

Viewing all 67020 articles
Browse latest View live


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