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

Re: Trying to retrieve the DimensionType of a Dimension

$
0
0

Well, if the DimensionType element is wrong, and the element id is wrong, then something else is hopefully right.

 

Unfortunately, I cannot imagine what, and you give no hint either.

 

In desperation, it might be worthwhile to read the documentation (of what, actually? is there any?) and find out what it is we are actually trying to achieve...

 


Re: How can the y-justification parameter be toggled to read-only for a new beam

$
0
0

Dear Jeremy,

thank you for the quick reply! I will try to answer your questions:

1. There is no problem setting the y-justification parameter for a beam that I manually create in Revit 2019 (used by our customer) via Structure Tab -> Beam ->  E.g., create W12x26 structural framing -> into a Structural Plan View. Then I can select the beam and edit the parameter in the Properites Palette. Using the Revit Lookup Tool, I can snoop the y-justification parameter for a new beam and I see, for example:
SnoopJustification.pngSnoop y-Justification


I don't see that there are unexpected changes before or after setting this parameter. 

2. If I step through the code sample that I have provided, I also see that the y-justification is usually not read-only.  I tried it for some standard beam families. In general, there seems to be no problem to set the y-justification for a new beam instance.

As far as I know, we previously never had a problem setting this parameter. It is just this particular customer report. We suspect there is some mechanism in Revit that can lock that built-in parameter behind the scenes ...

Some possible questions are:

* Can the y-justification be controlled by/as a shared parameter? Could that make it read-only? (IsShared == true)
* Can this built-in parameter somehow be restricted to be read-only by the family of the structural framing? (Currently not available from customer ...)
* Can the y-justification parameter be remote-controlled by another plugin, e.g., Dynamo? (Some other post mentioned this.)

 

Re: Wall create by profile

$
0
0

It is definitely a bug that I encountered too.
I worked around that bug by first determining what curveloop is associated with the wall boundaries and what curveloops are associated with openings, and then I can make use of the command "Create.NewOpening" to take care of the openings.

The main drawback is that now instead of having one wall with openings as one element, you have a solid wall as one element and each opening is also its own element.

 

 

Re: Trying to retrieve the DimensionType of a Dimension

NewAlignment() on extrusion top and bottom

$
0
0

Hello, 

 

I'm trying to create a cube in the family editor that has all 6 sides bound to a reference plane.  I was able to align the 4 sides in the x_y axis by using:

 

doc.FamilyCreate.NewAlignment(doc.ActiveView, solidExtrusion.Sketch.Profile[0][0].Reference, referencePlane.GetReference())

  

I'm having problems aligning the top and bottom of the cube to reference planes in the front view.  Does anyone have any insight on how to accomplish this?

 

Thanks in advance!

Re: Trying to retrieve the DimensionType of a Dimension

$
0
0

Thank you for your help and for sharing the link with me. I worked through the concepts in that handout and got it working.

 

Here's the working script :

using Autodesk.Revit.DB;
using RevitServices.Persistence;
using Revit.Elements;

namespace theWorks
{

    public class Dimensions
    {
        private Dimensions() { }

        public static Revit.Elements.Element GetDimType(Revit.Elements.Element dimension)
        {

            Document doc = DocumentManager.Instance.CurrentDBDocument;

            Autodesk.Revit.DB.Element UnwrappedElement = dimension.InternalElement;

            ElementId id = UnwrappedElement.GetTypeId();

            ElementType dimType = doc.GetElement(id) as ElementType;

            return dimType.ToDSType(false);

        }

    }
}

 

Re: Grouping Transactions - Single Undo

$
0
0

Even since Revit enforced transactions in all changes to objects, I started to struggle.

Do not get it wrong. I agree to enforce transaction, but you need to be more thoroughful. Compare with AutoCAD ObjectARX transaction manager. We know that a transation (or transaction group) generates a "state". States are used to roll back or forth (the undo/redo features). Sometimes we do not want to generate a state in the transaction manager (or like disable undo/redo for certain transactions). This way the transactions will not appear in the stack of states. So I am requesting Revit API to add a TransactionManager object (like in AutoCAD) to mark states, or specifically able to disable undo for next transaction or transaction group.

Re: Grouping Transactions - Single Undo

$
0
0

Thank you for your request.

 

Please add it as a wish to the Revit Idea Station and ensure it gets many votes.

 

Thank you!

 

Best regards,

 

Jeremy

 


Re: NewAlignment() on extrusion top and bottom

$
0
0

I would retrieve the extrusion geometry, find the underlying Solid and align its faces with the reference planes. 

 

Options opt = new Options();
opt.ComputeReferences = true;
GeometryElement ge = solidExtrusion.get_Geometry(opt);
foreach (var e in ge)
{
   if (e is Solid)
   {
      FaceArray fa = (e as Solid).Faces;
      foreach (Face f in fa)
      {
         //Align the face with corresponding reference plane
      }
   }
}

Of course, this would not work for extrusions with more than one sketch loop, and it is not very easy to find the corresponding reference plane. (The same as your proposed method)

 

Using Revit Lookup, I did a little research about the top and bottom faces, or I should say start and end faces of the extrusion (if you have created the extrusion in a different view than top view). It seems that when you get the faces of the extrusion solid, the first two faces in the array are the start and end faces of the extrusion. Which means you can align the sketch lines the way you mentioned and then get the geometry, get the solid, get faces and align the first two with your bottom and top reference planes. (See snapshots)

 

I also tried to verify my finding using the stable representation of the faces. (See https://thebuildingcoder.typepad.com/blog/2016/04/stable-reference-string-magic-voodoo.html)

 

And it seems token4 in the stable representation of the start and end faces is always 0 and 1 respectively and the other faces are assigned random integers. (keep editing the extrusion and those integers change!)

 

Again, this was only an observation and I'd love to know how you end up implementing this process!

 

Capture1.JPGCapture2.JPG

 

Capture3.JPG

Re: Issue with placing generic model at bottom of the wall

$
0
0

I am assuming it is a face-based generic model. I could not replicate this behavior. Whatever I tried it placed the generic model family vertical. But I figured FamilyInstance class has a IsWorkPlaneFlipped property that controls what you are dealing with. 

Re: problem: Dimension for column

$
0
0

I was successful. Thank you very much  

 

 

Dock a dockable pane like a view?

$
0
0

Does anyone know if its possible to have a dockable pane that docks in the centre like a regular view?

Re: Wall create by profile

$
0
0

Thanks for your reply.

 

I was also thinking it was some sort of a bug and good to hear i'm not the only one with this problem.

 

Going to start a workaround!

 

Re: Dock a dockable pane like a view?

$
0
0

Just looking at the Revit API docs, I would assume that the dockable pane position is defined by the DockPosition enumeration:

 

https://www.revitapidocs.com/2020/c28187c8-758f-76fe-6ded-1a98243fd20e.htm

 

Its members are not explicitly documented, so it is up to you to guess what they mean:

 

  • Top
  • Left
  • Right
  • Bottom
  • Floating
  • Tabbed

  

`Tabbed` looks like a pretty good candidate for what you want, I think.

 

Please try them out and let us know what you discover.

 

Thank you!

 

Best regards,

 

Jeremy

 

Re: Dock a dockable pane like a view?

$
0
0

Hi Jeremy,

Yes I tried Tabbed but without specifying a TabBehind pane it just shows as floating.

 

 


Re: Dock a dockable pane like a view?

$
0
0

Oh, I see. Yes, that makes sense.

 

Well, sorry, in that case, I would conclude that filling the entire view is not supported by the dockable panel.

  

I assume you can achieve something similar yourself implementing your own modeless .NET form instead.

  

Re: object creation through API

$
0
0

  could you have a look to my last post please?

Re: object creation through API

$
0
0

The procedure to research how to solve a Revit API programming task is almost always the same:

 

  • Reproduce the situation before and after the required modification manually through the user interface
  • Use RevitLookup and other database exploration tools to determine the exact differences, and how they look via API
  • Explore how to achieve the same changes in your add-in

 

Here are some more detailed examples:

 

 

To determine wall layer thicknesses and materials, you will probably need to make use of the CompoundStructure class:

 

 

It describes the internal structure of a wall, floor, roof or ceiling.

 

You can use shared parameters to add properties to any element.

 

Definitions.Create:

 

 

To add properties to a type instead of the instances, simply specify that they are type parameters when creating them.

 

The Building Coder discusses many aspects of this, e.g., 

 

  

Revit 2019 Fails to Launch on stations

$
0
0

We are unable to start Revit 2019 on any of 21 stations as of yesterday.

I found the this online 

Error: "RevitWorker.exe was not found." at launching Revit program crash

However installing pending Windows updates has not resolved the issue on the stations 

 

Extract from the log is below, I see a lot of posts on the issue without a resolution has anyone found a fix?

 

' 1:< DBG_WARN: Could not establish Worker Services!: line 140 of NOBLE\ManageWorkerServices.cpp.

'C 15-Aug-2019 12:04:00.617;   1:< logging finished virtualization services 

'C 15-Aug-2019 12:04:00.617;   1:< logging finished worker services 

'C 15-Aug-2019 12:04:00.618;   1:< logging erased queues 

'  0.182131-- 1:<<

' 0:< TaskDialog "RevitWorker.exe was not found."

'Id : TaskDialog_NoBLE_Worker_Initialize_Error

'CommonButtons : Close

'DefaultButton : Close

' 0:< Exception occurred

 

Re: Localization of add-in (multilanguage)

Viewing all 66789 articles
Browse latest View live


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