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

Re: C4R Event Handling - Collaboration For Revit / BIM 360 Team

$
0
0

Hi Jeremy,

Was this ever documented? I am still seeing similar behaviour now particularly on the DocumentSynchronizingWithCentral event.

 

Thanks,

Sean


rebar,rebarHookType

$
0
0

有些情况下,1、设置起点弯钩和终点弯钩无效?请问是什么原因? 例如,设置弯钩:rebar.SetHookTypeId(0,hookId1); rebar.SetHookTypeId(1,hookId2); 与 rebar.SetHookTypeId(0,hookId2; rebar.SetHookTypeId(1,hookId1); 是一样的,有的rvt项目没有任何效果。 2、使用结构样板与建筑样板创建的项目,可能会出现这个问题?

Creating a curve that passes through given points

$
0
0

Hi All,

 

I have a list of points (20 points in total) and I want to create a curve that passes through these points in a Revit project. By a little bit of research I found out that there is function NurbSpline.CreateCurve(Points, Weights) that can possibly do this for me. The question is as far as I know, the Spline does not pass through the points and it passes just near the points!. Is there any class or method available that can create a model line (curve) that actually passes through the points?

And another thing, what is that pass in variable "weight" stands for?

 

Thanks for the help,

Dave

Re: Creating a curve that passes through given points

$
0
0

So I tried another method which is pretty simple:

Hspline = HermiteSpline.Create(Points, False)

At first I thought that maybe it is not working because it was not showing me anything in the views. But when I checked the length and other properties for Hspline, they were correct! 

In order to see the curve, I placed small spheres along the curve and it seems that the curve has been created correctly but I don't know why its not been shown!

Should I create a model line and how can i do that?Points.PNG

 

How to place spot elevation on wall opening?

$
0
0

Im trying to create spot elevation on wall opening.using 

SpotDimension sd = doc.Create.NewSpotElevation(sectionView, fac.Reference, lCurvePnt, bendPnt, endPnt, lCurvePnt, true);

but im not getting Referance for wall opening.

Re: How to place spot elevation on wall opening?

$
0
0

What are you doing to retrieve the reference?

 

Re: Creating a curve that passes through given points

$
0
0

You probably need to adjust your view settings to ensure the curve is visible.

 

That has next to nothing to do with the API.

 

Explore manually through the end user interface how to set up the view correctly.

 

Once you know that, you can probably easily achieve the same programmatically though the API as well.

 

Re: rebar,rebarHookType

$
0
0

Translation:

 

In some cases,

 

1. Is the starting point hook and the end point hook invalid? Why?

 

For example, set the hook:

 

rebar.SetHookTypeId (0, hookId1);

rebar.SetHookTypeId (1, hookId2);

 

and

 

rebar.SetHookTypeId (0, hookId2;

rebar.SetHookTypeId (1, hookId1);

 

is the same, some rvt project No effect.

 

2. Is it possible to create a project using a structural template and a building template?


Re: Creating a curve that passes through given points

Re: rebar,rebarHookType

$
0
0

Your second question has nothing to do with the Revit API, so it would be better to ask it in a different forum.

 

Please note that this discussion forum is dedicated to programming Revit using the Revit API.

  

Therefore, you cannot expect an answer to a question such as yours relating to installation, product usage or end user support issues here.

 

You should try one of the non-API Revit product support discussion forums instead for that:

 

https://forums.autodesk.com/t5/revit-api-forum/this-forum-is-for-revit-api-programming-questions-not-for/td-p/5607765

 

The people there are much better equipped to answer your question than us programming nerds.

 

However, I'll respond with what I think anyway:

 

> Is it possible to create a project using a structural template and a building template?

 

No, a project can only be based on one single template.

 

However, you can set up the template yourself in any manner you like.

 

Therefore, you can combine the architectural and structural aspects of your choice yourself into one single template for your specific purposes.

 

Re: C4R Event Handling - Collaboration For Revit / BIM 360 Team

$
0
0

Dear Sean,

 

Thank you for your update, patience and perseverance.

 

Sorry to say, I have not had any response to my original question yet.

 

I re-prompted the development team for a response for you now.

 

Best regards,

 

Jeremy

 

Re: How to place spot elevation on wall opening?

$
0
0

1) I have collected solids from selected wall (in list "listOfWallSolids")

 

Options geomOptions = doc.Application.Create.NewGeometryOptions();

if (geomOptions != null)
{
   geomOptions.ComputeReferences = true;

}

 

// Get geometry element of the selected element
GeometryElement geoElement = oWallElemnt.get_Geometry(geomOptions);

foreach (GeometryObject geoObject in geoElement)
{

      solid = geoObject as Solid;
    
     if ( solid==null )
    {
       continue;
     }

   listOfWallSolids.Add(solid);

}

 

2) Then by iterating listOfWallSolids i tried to get face which contains opening (in "faceList")

 

foreach (Solid solid in listOfWallSolids)
{
    foreach (Face face in solid.Faces)
   {
  
      if (face is PlanarFace)
      {
    

           if (selectedWallElement.GetGeneratingElementIds(face) .Any(x => x == oOpening.Id))
           {
               faceList.Add(face);
           }

     }
 }

 

here in "faceList" i got the faces but reference are null.

 

Re: How to place spot elevation on wall opening?

$
0
0

Your algorithm looks perfectly OK to me. 

 

Can you verify right after retrieving the solids and faces from the wall that each face really is equipped with a valid reference?

 

By the way, unrelated to your question, doesn't this return too many faces for the opening?

 

Don't you need to add a check to filter out one specific face that you are interested in?

 

Re: How to Set Window Family Sill Height Instance Parameter editable on insert?

$
0
0

The families I work with are created using C # code, when are inserted into the Revit project, the data is read from an import file. The process is to read a template of the correct family, for example a window, add user parameters and define values for standard, instance and type parameters. This is when I need to define the parameter "Default Sill Height" as not locked. But I can't find any method in the API to define a non-locked standard parameter. The Set method is to define the value only.

 

Defining the value for a family parameter, using C # code, is not a problem, the problem lies in the need to set this parameter as not locked (the check box in the right column of the properties of each parameter in the table Dialogue of family type parameters).

 

What I need is, via C # code, to deactivate the locked state of the "Default Sill Height" type parameter, set to False?

 

Thanks,

 

Felipe.

Re: Projection Transformation

$
0
0

Dear Richard,

 

How did you end up solving this, please, so we can wrap it up?

 

Thank you!

 

Cheers,

 

Jeremy

 


Re: get IfcExporter setupnames

Access Sheet properties and modify

$
0
0

Hi,

 

I want to access the properties of selected sheet and modify them. I am able to do for properties which are listed under Identity Data

 

using

foreach (Element e in new FilteredElementCollector(doc).OfClass(typeof(FamilyInstance)).OwnedByView(viewsheet.Id))
{
   Parameter param1 = e.LookupParameter(ParameterName);
   if (param1 != null) { param1.Set(finalValue);  }

properties.png

 

 

but unable to do it for those under "Other"

properties1.png

 

This is just an example, I have few properties which are Associate Global Parameter and are placed inside Other in Properties window.

 

Thanks 

 

 

Re: How to place spot elevation on wall opening?

$
0
0

Face reference is giving null so instead of that i retrieved edges from face and used edge reference and it worked.

Thanks jeremy for help.

Re: Access Sheet properties and modify

$
0
0

Hi  ,

Filter the view sheet and try to access the parameters.

FilteredElementCollector collector = new FilteredElementCollector(doc).OfClass(typeof(ViewSheet)).WhereElementIsNotElementType();
                foreach(Element e in collector)
                {
                    foreach (Parameter p in e.Parameters)
                    {
                       if(p.Definition.Name=="Guide Grid")
                       {
                            p.Set("Guide Grid Name");
                       }
                    }
                }

You can use the above code to set the value for the parameters.

From my understanding, It is not possible to change the file path parameter via API.

If you want to set the value for the guide grid then you should first create guide grid elements in the active sheet and by using guide grid element name you can assign value for the guide grid parameter.

 

I hope this helps.

Exporting Coordination Alerts of multiple models Automatically

$
0
0

Hello Guys,

I am currently a BIM Coordinator in an A/E firm and we handle hundreds of models and I'm trying to make sure that no Coordination Alert is missed. is there any way to have all the Coordination Alerts exported once a week without opening every single model ?

Viewing all 66683 articles
Browse latest View live


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