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

What is the best avenue for programming in the family editor?

$
0
0

Want to manipulate, change, group, add, etc in the family editor. I have conversions from solidworks that are nested families. It would be nice to automate some repetitive and time-consuming tasks like changing the detail level of elements, grouping elements in Revit if the family names match names in a folder of families, and stuff like that.

Is it best through the API, Dynamo, C#, Python? Does anyone have an opinion?


Re: How to retrieve the Origin coordinates of location Curve in the wall?

$
0
0

Hi ,

 

Try this:

LocationCurve lc = wall.Location as LocationCurve;
XYZ origin = lc.Curve.GetEndPoint(0);
// Do something...

Re: APLICATIVOS PARA REVIT 2019 NÃO FUNCIONANDO

$
0
0

Hi ,

 

I tried to understand your descriptions by google translate.

It seems like you're trying to make your plugin but fail to install.

To make it short, you need to put two files in the proper folders to make your plugin work.

One is .dll file and the other is .addin file.

You may refer here to see how to make these two files and put them on the right file path.

KeynoteTable not availabe if BIM 360:// path via Desktop Connector

$
0
0

I have been developing an application for editing Keynotes within Revit and all is well except when the project has a Keynote file that has a BIM 360:// path via Desktop Connector The application tries to read and load the internal Keynote file with the external reference path, but it doesn't work with Cloud keynote files.

 

It doesn't matter if the file is a cloud model or not, but when the path is not local, no KeynoteTable is even available when iterating the TransmissionData GetAllExternalFileReferenceIds().

 

                TransmissionData transData = TransmissionData.ReadTransmissionData(ModelPathUtils.ConvertUserVisiblePathToModelPath(Functions.DocPath(doc)));
                var extRefs = transData.GetAllExternalFileReferenceIds();
                foreach (ElementId refId in extRefs)
                {
                    ExternalFileReference extRef = transData.GetLastSavedReferenceData(refId);
                    MessageBox.Show(extRef.ToString() + " : " + extRef.ExternalFileReferenceType + " : " + extRef.PathType);
                    if (extRef.ExternalFileReferenceType == ExternalFileReferenceType.KeynoteTable)
                    {
                        App.ControlID.keynoteFilePath = ModelPathUtils.ConvertModelPathToUserVisiblePath(extRef.GetPath());
                    }
                }

 

If the Keynote file path is local I get three types of ExternalFileReferenceTypes:

LocalPath.PNGLocal Keynote File

 

KeynoteTable.PNGKeynoteTableRevitLink.PNGRevitLinks
AssemblyCodeTable.PNGAssemblyCodeTable

 

If the Keynote file path is BIM 360 I only get two types of ExternalFileReferenceTypes:

Capture.PNGBIM 360 Keynote File

 

AssemblyCodeTable.PNGAssemblyCodeTable

 

RevitLink.PNGRevitLinks

 

Is there a way to get the KeynoteTable information when it is a Cloud path or is this information not available?  I think its odd that it doesn't even "see" a KeynoteTable when using a cloud path, rather than providing a cloud path that could be parsed for relevant / location association.

 

Any thoughts here?

 

-- Again, I want to reiterate that this in a LOCAL model, not a Cloud model, just the Keynote file has a cloud path.--

 

Thanks in advance for any support you can lend.

 

Re: How to retrieve the Origin coordinates of location Curve in the wall?

$
0
0

 Thank you for helping me solve the problem.

How to get point on ellipse?

$
0
0

Hi all!
I need to get point on the ellipse in the plan. I have start point and length of ellipse arc . How can i get coordinate of end point?

Re: How to get point on ellipse?

$
0
0

You will probably need more data about the ellipse itself, e.g., its centre, focal points, minor and major axis length.

 

From that and the data you mention you can determine the point location coordinates using standard geometrical methods, cf.

 

https://en.wikipedia.org/wiki/Ellipse

 

How to flip Roof surface?

$
0
0

Hi,

 

1. I created Roof with external layer Glass and internal side so we can see the better orientation.

Then using API I created roof using create method and then modify using SlabShapeEditor to adjust point coordinates. However, I notice is shape is expanding upwards orientation is always wrong. How to flip the roof surface?

 

 

2019-09-17 08_37_15-.png

 

2019-09-17 08_31_21-Edit Assembly.png

 

2. Also I there any method to automatically flip walls for a model with spaces if there is a wrong orientation? Currently, I do it manually by selecting walls and hit space. If I have a model with spaces we should have this option in API.


Re: How to flip Roof surface?

$
0
0

Better to submit separate unrelated questions in separate threads.

 

For flipping the roof, first explore how to achieve that manually in the user interface. By analysing what that actually modifies in the database, you can determine how to achieve the same programmatically:

 

https://thebuildingcoder.typepad.com/blog/2017/01/virtues-of-reproduction-research-mep-settings-ontology.html#3

 

For flipping the wall orientation, I think you can retrieve the wall location line, flip its direction, and assign the flipped line back to the wall, saying wall.Location = flipped_location_line.

 

Re: What is the best avenue for programming in the family editor?

$
0
0

Just to clarify, Revit only provides one API, and thou shalt have no other API beside it.

 

The built-in macro editor based on SharpDevelop uses the same API.

 

Dynamo uses the same API.

 

All different programming languages use the same API.

 

The Revit API is .NET, so all programming languages are compiled down into .NET intermediate language, aka IL.

 

IL can be decompiled back into any language you like, enabling easy translation of Revit add-ins from one language to another, cf. this almost antique post from 2008:

 

https://thebuildingcoder.typepad.com/blog/2008/10/converting-between-vb-and-c-and-net-decompilation.html

 

The choice is entirely yours.

 

My personal choice is pure Revit API using C#.

 

I also love Python, though, and Dynamo is a very fine thing indeed.

 

So are the Revit macros.

 

I hope this helps.

 

Best regards,

 

Jeremy

 

Re: Accessing ActiveUIDocument from outside of "Execute" method

Re: The Ceiling height of a room

$
0
0

You can use the ReferenceIntersector ray tracing functionality.

 

For instance, take a look at the Revit SDK sample SDK/Samples/FindReferencesByDirection/MeasureHeight.

  

This sample shows how to find the height of a skylight window above the ground level using the Revit API method FindReferencesWithContextByDirection (obsolete name).

  

You can also look at other discussions on this topic by The Building Coder. Some of them are listed here:

 

https://thebuildingcoder.typepad.com/blog/2017/03/rvtfader-avf-ray-tracing-and-signal-attenuation.html

 

Re: trouble reading entity schema

Re: ExternalEvent

Re: How to get point on ellipse?

$
0
0

I was able to solve using the function  curve.Evaluate


Re: How to get point on ellipse?

$
0
0

Perfect solution! Congratulations.

Re: How to flip Roof surface?

$
0
0

  OK will do it next time and log them separately.

1. Roof - I run lots of test with different point orientations. Unlike walls, it does not matter at all. I guess I come across Revit Limitation - So we can not have a roof with obtuse angle ( angle > 90 deg) that have correct roof orientation. 

Can you please confirm is this is correct?

2019-09-17 10_39_14-Topologic_Test.pptx - PowerPoint.png2019-09-17 10_39_37-Topologic_Test.pptx - PowerPoint.png2019-09-17 10_40_26-Topologic_Test.pptx - PowerPoint.png  2019-09-17 10_42_25-Rooftest.3dm (14 KB) - Rhinoceros 5.0 Commercial.png

 

which means this will not be possible to have correct in Revit... as lower half will always be wrong

2019-09-17 10_50_09-Autodesk Revit 2018.3 - [3D View_ {3D} - 000000_BHE_SAM_ver06e_2018testSpecial.r.png

 

2. walls - this is clear, it is easy to flip, just we need to know which one we want to flip. I believe there should be a function in Revit API that does this for us if we have rooms or space but I guess this is a new feature which will never happen so  we have to do it ourselves,

2019-09-17 10_52_48-Topologic_Test.pptx - PowerPoint.png

 

 

Re: How to flip Roof surface?

$
0
0

For the roof: can you achieve the desired effect manually in the user interface? That is always the first question. If you can, we can find a way to do it programmatically as well. If not, you can file a wish list item for it in the Revit Idea Station.

  

For the wall flipping: if you would like to implement such a command together with a small sample model containing a handful of rooms and spaces, I will gladly assist and clean it up for you for sharing with the community.

 

Very nice pictures, by the way!

 

Later, second thoughts on the roof: I now possibly have an idea what you actually mean. Do you have a roof with a compound structure, and you would like the bottom side of the compound structure to face upwards instead of downwards? If so, maybe you can solve this by implementing two similar but reversed compound structures for the two cases. I can well imagine that Revit is intentionally preventing the use of an upside-down compound roof structure, for many reasons. 

  

Subcategory Hidden Line Colour

$
0
0

I'm trying to find out how to control the colour of subcategory hidden lines, or if it can be done at all.

 

For example, I have a casework subcategory for metalwork which is set to green but when hidden it adopts the casework hidden line colour of black not the subcategory's colour of green.

 

I understand I can override by view but this can get a little tedious.

 

Any ideas please?

Re: Change the panel a connector is connected to

$
0
0

What is the parameter data type?

 

Revit manages some data types in parameters that do not fit into the int, double, ElementId and string classes supported by the Revit API, and are therefore inaccessible.

 

What does RevitLookup show?

 

Is the panel the host of the device?

 

For many elements, the host can only be set by the constructor, when creating a new element, and not modified later.

 

Viewing all 67020 articles
Browse latest View live


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