A couple of questions


#1

Hi

I am new to all the 3 worlds revit(basic), dynamo(just started), revit API(makes my head hurt and might be the monster under my bed).

I have written some basic dynamo codes mostly to query a model (like getting the cross section rotation angles, batch add shared parameters, batch add family parameters)

I have also installed the revit lookup and revitpythonshell packages.

These questions might be too basic:

  1. When I use RevitLookup to snoop an element it gives a whole lot of parameters.
    The get element parameters through dynamo node gives a subset of these.
    How do I access the rest of the parameters?

  2. The revit API documentation and help files are NOT in python (they are for either C# or .NET).
    The custom dynamo nodes are in python.
    How do I know what class/objects to use in the dot notation that is used in revit API.

  3. I am trying to rotate model elements by an angle. Wrote the following dynamo script.
    It was not working so I changed the .dyf file to DSCore.Lists (based on some posts here). Now it runs but the element is not rotated. The element is a model line

  4. How do I perform sequential operations in dynamo?
    Ex: Get the existing angle, rotate by angle, report the new angle, to actually see that something happened without having to freeze unfreeze parts of the code and re run it again.

  5. What is the difference between revit python shell window and the custom python node?

  6. What is UnwrapElements?

  7. Coming from MATLAB background is there a good IDE for all this, which helps me through the errors, (the autocompletion works)

  8. A comparison of if/then constructs and list map and lacing constructs ?

  9. Where do I start ?

I really appreciate anyone helping me out here.

Thanks


#2

A lot of questions here…

  1. Only the parameters under “Parameters” are available with Element.GetParameterValueByName.

  2. The classes and the objects are the same. There are a lot of examples of python scripts on this forum, like this one which describes some of the differences in detail: Dividing parts with dynamo

  3. You can get the location of the line, rotate the line in dynamo and set the location back:

  4. ?

  5. Probably a lot, but read here for a a good overview of stuff specific to Dynamo: https://github.com/DynamoDS/Dynamo/wiki/Python-0.6.3-to-0.7.x-Migration#revitapi

  6. The Revit API elements (Autodesk.Revit.DB) are “Wrapped” in a Dynamo class called Revit.Elements. The Revit element is called the InternalElement. UnwrapElement() is basically the same as getting the internal element back from the dynamo element. See here for an example on how it’s done: https://github.com/DynamoDS/DynamoRevit/pull/1679

  7. I don’t think so…

  8. please give examples

  9. I would say you are on the right place. Read all new topics on the forum and try to help others. Start with the easy tasks and use the search function diligently. Soon you’ll be able to do more complex tasks.


#3

Thanks for giving me some direction. @Einar_Raknes

  1. … But I can change the other parameters using Revit API / python ?

  2. :+1:

  3. How did you make a gif ?
    I was using the axis of the line for rotating it. So not sure whether it was rotating it in crossection or not? But I basically forgot my basic geometry that the axis about which you need to rotate is normal to the plane in which we have to rotate. (Must go back to school :stuck_out_tongue:)

  4. Ex: Get initial value of a variable which is say 4 and then add 2 to it the end result is 6. If everything works according to the plan the (final value - initial value - addition == 0) if not something did not work as planned.
    Now if I am doing this on say 100 elements I don’t have to check each one individually. I can just check the non-zero ones.
    I used to put in some checks like this in MATLAB to see if everything is working according to the plan/code.
    With a text code the sequence is defined by how the code is written.
    But I am not sure with multiple operations being done to each element in dynamo what is the sequence of operation.

So how do sequential operations work, basically in what sequence does dynamo update the parameters ?

5 Thanks

6 Thanks

7 Is there something in work for this ?

8 Ohh I am looking for examples for the same.

9 Thanks


#4
  1. Clockwork package have a lot of nodes for those, and yes the properties can be changed in API unless they are read-only. If you provide an example (create a new topic with a descriptive title) a lot of people are ready to assist you.

  2. Animated GIF files

  3. The excecution order is from the top left and follows the wires of the nodes. Sometimes you can create a “passtrough” node to enforce the order of excecution. (To prevent one branch from calculating faster than the other). Search for the forum for examples.

  4. I dont know…

  5. Forum search? Try to make a list and do some operations to it, create a topic whenever you get stuck.