@miguelpupocorreia wrote:
I wish to automatically install light fixtures into given points on Revit using Dynamo. The plan is to install all the different light fixtures at the same time.
In other words, you want to program a dynamo script which will place Revit light fixtures according to a list of coordinates in one operation.
I have successfully extracted the x and y coordinates (from a relative point); and the type of light fixture from Excel. I have the relative point coordinates as well.
You input for the x, y coordinates were extracted from the Revit project and they are relative to a known point modeled in x,y the Revit project. If the light fixtures are not installed in the ground and/or on multiple levels you may also need z values. Please confirm how to generated the x,y,z coordinates.
The excel file also contains the family and type names of the light fixture you want to use.
I have joined the x and y coordinates by using "Point.ByCoordinates". I am struggling with the substitution of the type of fixture and their respective families. I opened the different family types with "Family Types" . The type of light fixture that comes from the excel is opened with "List.GetItemAtIndex".
First of all, light fixture families come in a variety of hosting types (wall, ceiling, level). To use x,y,z coordinates, the fixture must be hosted by level. Your Point.ByCoordinates will supply the x,y and the height above the reference level will be z (or z-reference z).
Reading the family name from the excel file is the next step with List.getItemAtIndex resulting in a string of the family name.
My logic is the following: Replace the type of light fixtures with their respective families. Align them with their corresponding points. The Family types will now have an assigned location thus the corresponding lights will be generated in the Revit sheet.
This was not clear at the beginning, did you extract the coordinates of existing instances of light fixtures that you want to move or did you want to create new light fixtures a the points in your file?
If you are moving the existing families bypass the name of the family and extract the Element.Id of the selected light fixtures. You can then use this unique identifier to move the existing instances after processing the coordinates in your excel file.
-I am struggling to find the correct functions with the desired inputs and outputs in Dynamo.
Depending on what the new coordinates need to be with respect to the original coordinates are, it may not be necessary to use an excel file. A simple translation can be realized in the same dynamo script (ex. move 1m up and 2m in the x). If you are working with existing lights, you need to collect their element.id, coordinates in plan (x,y), height above plane (z).
-I am struggling with the correct format of different objects.
Experience in Dynamo will come from understanding what type of format is required for each node. Posting your script and error messages will help debug where you are trying to pass incompatible formats.
-Can points be created in the Revit sheet according to a set reference point in Dynamo or do they need always a line?
Terminology is important with Revit. You will be probably working from a plan view and not a Revit sheet view. There are no 3D families in a sheet view. What you have on a sheet are a series of 2d views of the 3D model. The plan view is defined by it's reference level on which you can extract relative x,y coordinates.
Rather than a line, it is more correct to say a vector that locates the reference point on the view with respect to Revit's internal origin. This is an important concept because Dynamo allows you to work by default in Revit's internal coordinate system or define and use other coordinate systems. When moving this relative to the x,y,z of a default Revit projects internal coordinate system, it is easier to not have to deal with relative coordinates.
To continue getting help, you may need to post screen shots of you script in development. If it starts becoming very technical, you may find better help in the "Revit API Forum" or with the Revit DynamoBim forum.
Hope this helps,
-luc