Revit API wall Thickness using Revit api 2020 - revit-api

I am working at revit api to get walls of special room this is the part i have completed with Projecting rays technique. This is the main point that i am unable to do Wall thickness. Is there any way i can extract wall thickness. i am using revit 2020.
Thank you

You can only get the wall width via the WallType of the wall.
On top of that, Revit will give you the width in its native unit (usually the imperial system). It is possible to convert it easily with the UnitUtils class. Documentation here
The first step is to get the WallType. To do that, you have to retrieve the type ElementId via GetTypeId(), then the element via document.GetElement(), and finally cast it to WallType.
From the type, we obtain the width in Revit native units, which we convert into milimeters via the UnitUnits class.
Here is a code snippet:
WallType wallType = document.GetElement(wall.GetTypeId()) as WallType;
double nativeWitdh = wallType.Width;
double milimeterWidth = UnitUtils.ConvertFromInternalUnits(nativeWitdh,DisplayUnitType.DUT_MILLIMETERS);
Best regards,
François

Sure, very easy.
Use the WallType Width property.
You could very easily have answered this question by yourself, either by searching the Internet or by exploring the wall and its properties using RevitLookup.
Please perform some minimal research for yourself before asking a question and making others do the work for you.
Here is some more advice on researching how to solve a Revit API programming task.

Related

Revit API - Copy a Face from the project into a family

I have a Revit Face, think of a RuledFace with holes, or NurbsSurface, maybe. I need a copy of that Face in a new family document.
Currently, I'm tesselating/triangulating the face and put those triangles into my family, which kind of works, but I have these intermediate edges between the triangles, which is very bad in my scenario.
I could not find a way to create e.g. a BRepBuilder with the exact information of the Face element.
The easiest way to transfer geometry from one Revit document to another is by using the copy and paste functionality provided by the CopyElements method. Examples of using it are provided in the Revit SDK samples DuplicateViews and GenericStructuralConnection.

How do I select walls along a particular axis, among all the other walls, in Revit using the Revit API?

I want to change the height of all walls but the length of walls only in a particular axis, for instance, along the x-axis.
Consecutively, could you also tell how I could alter the similar dimensions for a house? Where there are connected walls?
I see nothing in this code that means it does not work.
However, it seems to me that it does not make much sense.
One would seldom constrain all wall heights to be user defined to a certain value; instead, in most Revit models, walls are constrained to reach from a bottom level to a top level. Then, if the height of all walls needs to be modified, you would modify the elevation of the top level only.
The logic of the code guarantees that the wall location line will only be modified if the newWallLine equals XYZ.BasisX. This may never be the case, since the line is a Line object and the vector an XYZ.
I would recommend researching exactly what you wish you achieve and how to do so manually in the end user interface before addressing the task programmatically.
In general, if a feature is not available in the Revit product manually through the user interface, then the Revit API will not provide it either.
You should therefore research the optimal workflow and best practices to address your task at hand manually through the user interface first.
To do so, please discuss and analyse it with an experienced application engineer, product usage expert, or product support.
Once you have got that part sorted out, it is time to step up into the programming environment.
I hope this clarifies.

How to find Ramp landing space and Intermediate landings in Revit API?

I am trying to find Landing Spaces as well as Intermediate Landings for Ramps using Revit API, for a few of my models. So far I have tried to find Start and Endpoints of the ramp using location parameters as mentioned in the following blog space (How to find start/end of ramp in revit, perhaps with sketches?) , but it seems that this parameter is unavailable in the models I am trying to use.
 I tried to explore any other way using Revit API functionalities but with no visible success so far. Also, I am new to Revit Api's and as such have a limited understanding of what features are available in API.
Can someone help me Identify Ramp Landings or Ramp endpoints?
Ramp Location
Ramp Property Pallete
I see three possible approaches:
Location
Sketch
Geometry
Using the Location property, casting it LocationCurve and grabbing the endpoints from that as suggested in the other discussion you link to would be the optimal solution.
Another approach mentioned in that thread is to use the sketch defining the ramp to determine its start and end points. Getting hold of the sketch elements is not completely trivial, but absolutely doable, as explained in The Building Coder discussions on
Stable Reference Relationships
Retrieving and Snooping Dependent Elements
If all else fails, the final alternative would be to grab and analyse the ramp geometry to deduce the required information from that.

IBM Graph query result to Graph representation

Is there any way that we can plot the query result from IBM Graph DB to a graph representation?
IBM graph has UI for basic plotting of nodes and edges. feel free to reach out to us on our public slack for help there: http://ibm-graph-slackinvite.mybluemix.net/
this may be helpful: https://cambridge-intelligence.com/keylines/ibm-graph/
there are also multiple graphing utilities you can implement, but you have to do the work of mapping the graph..etc (ex: https://bl.ocks.org/mbostock/4062045) you choice would also depend on how much you are trying to display and what you are trying to do (ex: zooming, clustering, filtering, calculations to best show the graph...etc). feel free to come to the public slack channel i mentioned and we can help ya with our experience.

"Split Wall" using Revit API

I have a wall and have to split it using Revit API. I have placement points as an input and need to split the wall based on those points. Do we have any command to achieve this using Revit API?
Any help would be greatly appreciated.
No there is no direct method for that. You'll have to make a copy of your wall with ElementTransformUtils.CopyElement method, then move one point of the original and one point of the copy to the location of your split point. To move the points, you have to create and assign a new curve to the wall location:
((LocationCurve)wall.Location).Curve = newCurve;
What do you mean by split wall? You can split certain family instances, such as beams, columns, etc. using the FamilyInstance.Split method. That does not apply to walls, however. You can split faces on a wall to apply different materials. For that, please refer to the FaceSplitter class.

Resources