I want to hide same elements in importInantance.
I see a Plug-in software can do it.
How can I achieve this?
I want to hide same elements in importInantance.
I see a Plug-in software can do it.
How can I achieve this?
I am having walls they are making closed loop .want to place the family instances with fixed distance in that.Using ReferenceIntersector i am trying. I got ray direction but in referenceWithContext value is remain null so not able to proceed further.
Reference oref =uiApp.ActiveUIDocument.Selection.PickObject(Autodesk.Revit.UI.Selection.ObjectType.Element);
Element ele = activeDoc.GetElement(oref);
LocationCurve ocurve = ele.Location as LocationCurve;
XYZ startPoint = ocurve.Curve.GetEndPoint(0);
XYZ endPoint = ocurve.Curve.GetEndPoint(1);
XYZ rayDirection = endPoint.Subtract(startPoint).Normalize();
List<BuiltInCategory> builtInCats = new List<BuiltInCategory>();
builtInCats.Add(BuiltInCategory.OST_Walls);
builtInCats.Add(BuiltInCategory.OST_GenericModel);
ElementMulticategoryFilter intersectFilter = new ElementMulticategoryFilter(builtInCats);
FilteredElementCollector collector1 = new FilteredElementCollector(activeDoc);
Func<View3D, bool> isNotTemplate = v3 => !(v3.IsTemplate);
View3D view3D = collector1.OfClass(typeof(View3D)).Cast<View3D>().First<View3D>(isNotTemplate);
ReferenceIntersector refIntersector = new ReferenceIntersector(intersectFilter, FindReferenceTarget.Element, view3D);
refIntersector.FindReferencesInRevitLinks = true;
it is working fine upto this line
ReferenceWithContext referenceWithContext = refIntersector.FindNearest(startPoint, rayDirection);
but here it is showing null.
After getting this I want to place family with fixed distance apart .
Hi
Is your floor is Floor:Architectural or Floor:Structural?
If your Floor is structural and you use
BuiltInParameter.STRUCTURAL_FLOOR_CORE_THICKNESS
then you will get the Core thickness of the floor
otherwise
for architectural floor it will be always 0.
Hi,
while reading schedules from a Revit file, but a schedule contains a parameter called function 2 times. I just export it to a text file and try to read using ScheduleDataParser .
ScheduleDataParser parser = new ScheduleDataParser(Path.Combine(_export_folder_name, FileName + _ext));
But it throw exception like "A column named 'Function' already belongs to this DataTable."
can you help me to solve the issue or give an alternative for this.
Thanks in Advance.
Dear Chris,
I didn't find potential Revit API which will result in this issue.
The problem here is some assemblies are not loaded successfully, I guess this is why the window rendering doesn't work; you may refer to these page on how to load assemblies properly, hope it's helpful:
https://docs.microsoft.com/en-us/dotnet/api/system.appdomain.assemblyresolve?view=netframework-4.7.2
https://stackoverflow.com/questions/33109558/revit-api-possible-newtonsoft-json-conflict
How to calculate height and width of cuveloop as shown below?
Hello
Before to begin write any programs in c++ for Revit, I want to be sure that we can to do everything with this language.
Are there c ++ restrictions?
I can read some things were not possible...
Exemple :
-Manage color choices
-Access the formulas of a nomenclature;
-No JIG as in AutoCAD;
-You can not create project settings, only shared settings;
-You can not rename a project parameter;
-You can not create / edit a label in a label;
-You can not create custom object snaps;
-You can not overload the drawing / behavior of an object as you can with AutoCAD;
-No transient graphics like AutoCAD or Inventor (you can do some things with AVF, but it's limited);
-We can not do much with the variants;
-Decompose a CAD import symbol (DWG for example). However, we can find the geometry contained in the symbol and recreate elements but it's a lot of work;
-Attach a linked file;
-Modify an in-situ family;
-Select a point in 3D (you can only select a point on the active construction plane).
Thanks
Arnaud
Hi list,
Unfortunately the Solid-Intersection-Approach does not work as expected, since the call to
BooleanOperationsUtils.ExecuteBooleanOperation(sphere, theSolid, BooleanOperationsType.Difference);
can lead to an exception:
"Failed to perform the Boolean operation for the two solids. This may be due to geometric inaccuracies in the solids, such as slightly misaligned faces or edges. If so, eliminating the inaccuracies by making sure the solids are accurately aligned may solve the problem. This also may be due to one or both solids having complexities such as more than two faces geometrically meeting along a single edge, or two coincident edges, etc. Eliminating such conditions, or performing a sequence of Boolean operations in an order that avoids such conditions, may solve the problem. "
It is not really clear to me, why this exception is thrown, because in the case I catch it, no complicated solids were present (just one solid consisting of two rectangular boxed and the sphere). The sphere is defined straight forward:
XYZ profileArcPlus = center + new XYZ(0, 0, radius);
XYZ profileArcMid = center + new XYZ(radius, 0, 0);
XYZ profileArcMinus = center - new XYZ(0, 0, radius);
Frame frame = new Frame(center, XYZ.BasisX, XYZ.BasisY, XYZ.BasisZ);
List<Curve> profile = new List<Curve>();
profile.Add(Line.CreateBound(profileArcPlus, profileArcMinus));
profile.Add(Arc.Create(profileArcMinus, profileArcPlus, profileArcMid));
CurveLoop curveLoop = CurveLoop.Create(profile);
SolidOptions options = new SolidOptions(ElementId.InvalidElementId,
ElementId.InvalidElementId);
Solid sphere = GeometryCreationUtilities.CreateRevolvedGeometry(frame, new CurveLoop[] { curveLoop }, 0, 2 * Math.PI, options);
Nope, sorry. Cool, thank you for voting! No problem whatsoever, it is a pleasure to help and another to misunderstand... enjoy it either way :-)
Dear Andrei,
I'm communicating with engineering team on this, will keep you updated on any progress.
Dear David,
Can you provide a reproducible case for it? I didn't find problematic code in your sample code.
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
Thank you for reply.
It is now working when draw walls in existing project.
But Now having another isssue. When reference intersector is use
ReferenceWithContext referenceWithContext = refIntersector.FindNearest(startPoint, rayDirection);
Reference reference = referenceWithContext.GetReference();
XYZ intersection = reference.GlobalPoint;
Not able allocate correct intersection
when i place family instance at intersection it is placed on the wall itself (where i have given the reference) although their is no intersection on this point.
Dear Javier,
I looked at the built-in Revit materials in the material browser.
Looking at the standard built-in Concrete material, I see that it has a physical description saying, "Default Concrete f'c=3.5 ksi".
I just published a new version of RevitLookup that enables the snooping of appearance assets:
Using that version, I find that the description of the built-in Concrete material is located in the 'Description' parameter along the following path:
I hope that this new version of RevitLookup will enable you to find the corresponding paths for the other values you are after as well.
Best regards,
Jeremy
I'm afraid neither Revit API nor AdWindows API provides interface to trigger the Ribbon size changing.
You may consider to use windows API to achieve this, please refer to pages below:
https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-findwindowa
Hope it's helpful, please correct me if I missing anything.
I have create 3 circles.
First is with default, Second with RED , third is with Blue.
But all circles are created with Blue. How to correct it ?
Reference refe = sel.PickObject(ObjectType.Element,"Select Object"); Element elem = doc.GetElement(refe); ElementId elemid = refe.ElementId; XYZ Cen_pt = ((LocationPoint)elem.Location).Point; XYZ Nor = new XYZ(0, 0, 1); double bottomorleftoffset = 1, ToporRightoffset = 1; IList<Parameter> param1 = new List<Parameter>(); XYZ pt1 = elem.get_BoundingBox(doc.ActiveView).Min; XYZ pt2 = elem.get_BoundingBox(doc.ActiveView).Max; using (Transaction tx = new Transaction(doc)) { tx.Start("Transaction Name 1"); KJU.Draw.DrawCircle(uidoc, Cen_pt, 0.01, Nor); Plane plane1 = Plane.CreateByNormalAndOrigin(Nor, pt1); SketchPlane skplane1 = SketchPlane.Create(uidoc.Document, plane1); Arc arc1 = Arc.Create(plane1, 0.05, 0.0F, 2 * 22 / 7.0); ModelCurve mc1 = uidoc.Document.Create.NewModelCurve(arc1, skplane1); GraphicsStyle gs1 = mc1.LineStyle as GraphicsStyle; gs1.GraphicsStyleCategory.LineColor = new Color(250, 0, 0); doc.Regenerate(); Plane plane2 = Plane.CreateByNormalAndOrigin(Nor, pt2); SketchPlane skplane2 = SketchPlane.Create(uidoc.Document, plane2); Arc arc2 = Arc.Create(plane2, 0.1, 0.0F, 2 * 22 / 7.0); ModelCurve mc2 = uidoc.Document.Create.NewModelCurve(arc2, skplane2); GraphicsStyle gs2 = mc2.LineStyle as GraphicsStyle; gs2.GraphicsStyleCategory.LineColor = new Color(0, 0, 250); doc.Regenerate(); tx.Commit(); }
Dear Kevin,
Thank you for your query.
I looked at the main web page describing the BIM Interoperability Tools and see the Enhanced DWG Exporter you mentioned:
I am not aware of any API for driving this, nor would I assume that one currently exists.
However, I am checking with the development team for you to make sure.
Best regards,
Jeremy
Dear Arnaud,
The Revit API is based on .NET.
You can use any language support .NET to interact with it.
There are no differences in functionality between different .NET languages.
A lot of the items in your list have nothing to do with Revit.
It seems you come from the AutoCAD side of programming.
That may make it harder for you to learn (and accept) how to work in the BIM world.
Revit and its API is different:
https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.41
Best regards,
Jeremy
Learn how to do it manually in the user interface first.
One easy way to get a pretty good approximate value would be to tessellate the curve and determine the minimum and maximum resulting vertex coordinates:
https://apidocs.co/apps/revit/2019/f95f3199-3251-c708-c5a3-a0e9ef95ecfa.htm
Thanks for timely help. I have return to correct path.