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

Re: room boundaries from room.ClosedShell() or room.GetBoundarySegments

$
0
0

yes, your proposition is valid in most cases, seems Revit API (and Dynamo) don't have option to create room based on center line, have to do it manually as suggested by you and Autodesk support.

yes, Revit is able to create room and compute area/volume based on level, in my case, i have to use duplicate level workaround: https://www.revitforum.org/architecture-general-revit-questions/38049-sloped-room-space.html

but strangely Revit gbXML export function will export Revit room based on center line (at least for wall, not sure about other bounding elements) no matter what setting? don't know any logic or magic behind it?

thanks Benoit for your help.


Re: Revit UI Becomes Unresponsive

$
0
0

Dear James,

 

Thank you for your query and update to the automatically generated ADN case 14170467 [Revit UI Becomes Unresponsive].

 

You explained that you were able to solve the problem yourself, and that Revit was becoming unresponsive because the 'Open Project' dialogue was displayed off-screen, resulting in a locked Revit main window and an inaccessible dialog window.

 

I agree that it would help to allow the dialogue boxes to be viable from the windows peek feature, hovering over the Revit icon in the taskbar.

 

Thank you for the good suggestion!

 

I will mark this query as resolved here in the forum now.

 

Best regards,

 

Jeremy

 

Re: Returning value from a function

$
0
0

Presumably, the `if` condition within the `foreach` loop is never fulfilled.

 

Try debugging the code to see exactly what happens.

 

 

Import Instance and line patterns

$
0
0

Is it possible to get the line patterns used by lines in an import instance?

 

I've noticed if I insert a CAD file the lines look correct but if I explode the block in Revit all the lines look solid. I've also noticed the GraphicStyleType on some lines is 3 but the API help file only shows Cut or Projection.

How do I get all the outermost walls in the model?

$
0
0

I'm sorry, I'm nervous because my English is not very good~

 

How do I get all the outermost walls in the model?

 

It's like a picture shown in the picture::

12.pngthanks!

Re: GETCENTERLINECURVES for stirrup rebar

$
0
0

Hi,

Please see my codes, it shows how to transform stirrup rebar curves to horizontal plane.

Re: Import Instance and line patterns

$
0
0

Dear Paul,

 

Thank you for your query.

 

You should be able to access absolutely all the line patterns in the entire database via a filtered element collector and RevitLookup.

 

Have you tried that?

 

I searched the Revit API docs and Internet for GraphicStyleType and found no further information on the mysterious number 3.

 

What does the user interface display string say about a line with such a setting?

 

Does this problem appear only when working through the API, or do you observe the same behaviour when working manually through the user interface?

 

If so, the product support teams may have some more fruitful suggestions for you.

 

Sorry I have nothing further to suggest off-hand...

 

Best regards,

 

Jeremy

 

dwg import option - SetLayerSelection doesn't work

$
0
0

Hello everyone,

I am trying to set the dwg's layers to import into Revit by using 'SetLayerSelection'.

But it doesn't work with the following code:

 

// DWG Import Options
DWGImportOptions dwgImportOption = new DWGImportOptions();
ICollection<string> layerSelection = new List<string>() { "layername" };

 

dwgImportOption.ColorMode = Autodesk.Revit.DB.ImportColorMode.BlackAndWhite;
dwgImportOption.CustomScale = 0.0;
dwgImportOption.Unit = Autodesk.Revit.DB.ImportUnit.Millimeter;
dwgImportOption.OrientToView = true;
dwgImportOption.Placement = Autodesk.Revit.DB.ImportPlacement.Origin;
dwgImportOption.ThisViewOnly = false;
dwgImportOption.SetLayerSelection( layerSelection );

 

I would highly appreciate if you could support me.

Thank you.


Re: How do I get all the outermost walls in the model?

$
0
0

Take a look at the `DirectionCalculation` Revit SDK sample and The Building Coder discussion of it
on south facing walls:

 

http://thebuildingcoder.typepad.com/blog/2010/01/south-facing-walls.html

 

That will provide a good starting point for you.

 

It uses the built-in wall function parameter `FUNCTION_PARAM` to filter for exterior walls.

 

I updated the code presented there and added it to The Building Coder samples for you, in the CmdCollectorPerformance.cs module lines L293-L323:

 

https://github.com/jeremytammik/the_building_coder_samples

 

https://github.com/jeremytammik/the_building_coder_samples/blob/master/BuildingCoder/BuildingCoder/CmdCollectorPerformance.cs#L293-L323

 

First, we implement a predicate method `IsExterior` that checks this parameter value to determine whether a wall type is exterior or not:

 

  /// <summary>
  /// Wall type predicate for exterior wall function
  /// </summary>
  bool IsExterior( WallType wallType )
  {
    Parameter p = wallType.get_Parameter(
      BuiltInParameter.FUNCTION_PARAM );

    Debug.Assert( null != p, "expected wall type "
      + "to have wall function parameter" );

    WallFunction f = (WallFunction) p.AsInteger();

    return WallFunction.Exterior == f;
  }

 

With that, you can retrieve all exterior walls with a filtered element collector like this:

 

  /// <summary>
  /// Return all exterior walls
  /// </summary>
  IEnumerable<Element> GetAllExteriorWalls(
    Document doc )
  {
    return new FilteredElementCollector( doc )
      .OfClass( typeof( Wall ) )
      .Cast<Wall>()
      .Where<Wall>( w =>
        IsExterior( w.WallType ) );
  }

 

Since the wall function filter is just checking a parameter value, the performance of this filtering process could be significantly enhanced by using a parameter filter instead of the slow .NET based `IsExterior` method post-processing:

 

http://thebuildingcoder.typepad.com/blog/2010/06/parameter-filter.html

 

Cheers,

 

Jeremy

 

Re: Temporary Transaction Trick Exception

$
0
0
I tried to use one transaction with a rollback. But when I use this method, I get errors Autodesk.Revit.Exceptions.InternalException

Re: Schedule - calculated value / field

$
0
0

Hi All,

 

Would really love to hear that it's been added in the Revit 2019? Any updates?

 

Best Regards,

Khaled

Re: How do I get all the outermost walls in the model?

Re: Schedule - calculated value / field

Re: Temporary Transaction Trick Exception

$
0
0
var edges = FindEdges(edoor as FamilyInstance, e as Room).ToList(); These are the edges created by the door in the wall. If I'm using one transaction, I get an error: an exception of type 'Autodesk.Revit.Exceptions.InternalException' occurred in RevitAPI.dll but was not handled in user code Additional information: A managed exception was thrown in by Revit or by one of its external applications. This is the method of obtaining edges: private static IEnumerable FindEdges(FamilyInstance door, Room room) { var wall = (Wall)door.Host; return wall .get_Geometry(new Options { ComputeReferences = true }) .OfType() .SelectMany(x => x.Edges.OfType()) .Where(x => IsDoorEdge(x, door)) .Where(IsVerticalEdge) .Where(x => IsWallExteriorFaceEdge(x, wall.Orientation, room, door)); }

Re: How do I get all the outermost walls in the model?


How to share geometry?

$
0
0

Hi,

     I want to export model data to 3rd party rendering engine.As far as know,useing Element.get_Geometry() can get the

3d representation of the element,and if the element is familyinstance,using FamilyInstance.GetOriginalGeometry() can get the original geometry of the instance.And there is a method,FamilyInstance.GetTransform() can get the transform of family instance.But,if I follow this workflow,there will be one (or a group of)geometry for each element,even if some of them are using the same geometry.

     So,my question is,how to share geometry,so that I can call Element.Geometry() only once for those elements that using same 3d representation(or  Famliy Symbol)?

Re: How do I get all the outermost walls in the model?

$
0
0

Thank you for such a quick answer, Jeremy!

As mentioned above, this method is judged by the parameters of the wall. However, I hope to judge whether it belongs to the outermost wall through the spatial location of the wall, because most engineers do not want to modify the type of the outermost wall later, which will increase a lot of work.

How to set foreground in import image?

$
0
0

Dear All,

 

When I insert Raster Image(via API) into Revit by default it is displayed as "background". Is there any way I can do it by "Foreground" Option?

 

Thanks Advance,

Naing Oo

Re: How to set foreground in import image?

$
0
0

Hi,

 

picElement.get_Parameter(BuiltInParameter.IMPORT_BACKGROUND).Set(0);

 

Revitalizer

Re: How to set foreground in import image?

$
0
0

It is exactly what I want.

 

Thanks,

Viewing all 66835 articles
Browse latest View live


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