Thanks for video. Great step by step coding. A question, why did you add a transaction and commit to your code? We could just show a taskdialog without transaction.
Hi Danny. Thanks for the videos. Well done. It looks like to have an app that starts when you open a Revit project. It appears to prompt the user to set the current workset. Could you share how that is done? Thanks!
Hi Danny! Nice job. I'm using your recommendations. How would you do if you have a button form so when you click it, you can select elements? Thanks in advance!
I like using the XAML and C# to build UIs th-cam.com/video/ckcqm6rqPB8/w-d-xo.html here is the code behind the event handler for the button. IList pickedElements = uidoc.Selection.PickElementsByRectangle("Select by rectangle"); if (pickedElements.Count > 0) { // Collect Ids of all picked elements IList idsToSelect = new List(pickedElements.Count); foreach (Element element in pickedElements) { idsToSelect.Add(element.Id); } // Update the current selection uidoc.Selection.SetElementIds(idsToSelect); best.
Depending on which IDE you are using you might have to start Revit in debug mode. I use VS so I hit the play button an it is setup to launch Revit I put a break in areas where I think the error is happening and then read the data to see if it has null or list is out of index. When your code fails it will also give you a line number where the error occurred. You will be spending a good amount of time doing this as you build tools so it’s good to get started :)
I had problems with your sample zip. I just tried it step-by-step with the Revit-API-Wizard and your code and it finally worked. But I have two Questions: 1. I know how to get the ElementID and Element-Name but how do we show both information side by side ? I can only choose one with your code. For example like this: [Wall1] [14324] 2.Do you know how to convert the List-Output to a Excel-file?
Delil, You have two options. One you can make a dictionary which adds items with a key and a value. Key could be your id and value your element name. Your second option could be an object (this is why C# is so powerful and much more dynamic then Dynamo). The object can hold several items such as wall id, wall name, wall type, wall end and start point location etc.. and can be looked up edited. if you need more help I'd be happy to send you sample code for both of these.
Thank You, more please!!! for example: Creating a inserting families... Create assemblies.... wow!!! great video...
Thank you for the video, is there a way to select and unselect elements using c#
Thanks for video. Great step by step coding.
A question, why did you add a transaction and commit to your code? We could just show a taskdialog without transaction.
If I wanted to select all the elements of the model and filter by categories how could I do it?
Thank you for your sharing
how do you select element from a linked model, specially when you need to select more elements of the same type.
Hi Danny. Thanks for the videos. Well done. It looks like to have an app that starts when you open a Revit project. It appears to prompt the user to set the current workset. Could you share how that is done? Thanks!
I want this too....how did you do it?
for compare elementy type in family for you kwon is WALL the select items/object
Hello please how can access to geometry of an element in a linked file (file rvt)
Hi Danny! Nice job. I'm using your recommendations. How would you do if you have a button form so when you click it, you can select elements? Thanks in advance!
I like using the XAML and C# to build UIs
th-cam.com/video/ckcqm6rqPB8/w-d-xo.html
here is the code behind the event handler for the button.
IList pickedElements = uidoc.Selection.PickElementsByRectangle("Select by rectangle");
if (pickedElements.Count > 0)
{
// Collect Ids of all picked elements
IList idsToSelect = new List(pickedElements.Count);
foreach (Element element in pickedElements)
{
idsToSelect.Add(element.Id);
}
// Update the current selection
uidoc.Selection.SetElementIds(idsToSelect);
best.
Hi Danny this is really good learning API. and i have qeustion about when i click cancle button, there is some error. how could i figure?
Depending on which IDE you are using you might have to start Revit in debug mode. I use VS so I hit the play button an it is setup to launch Revit I put a break in areas where I think the error is happening and then read the data to see if it has null or list is out of index. When your code fails it will also give you a line number where the error occurred.
You will be spending a good amount of time doing this as you build tools so it’s good to get started :)
Thank you !
I email you a sample zip up. You can find the sample code here as well.
revitdynamoapi.blogspot.com/
I had problems with your sample zip. I just tried it step-by-step with the Revit-API-Wizard and your code and it finally worked. But I have two Questions:
1. I know how to get the ElementID and Element-Name but how do we show both information side by side ? I can only choose one with your code.
For example like this: [Wall1] [14324]
2.Do you know how to convert the List-Output to a Excel-file?
Delil, You have two options. One you can make a dictionary which adds items with a key and a value. Key could be your id and value your element name. Your second option could be an object (this is why C# is so powerful and much more dynamic then Dynamo). The object can hold several items such as wall id, wall name, wall type, wall end and start point location etc.. and can be looked up edited.
if you need more help I'd be happy to send you sample code for both of these.
that would be very nice of you if you send me the sample codes!
delilplayer@hotmail.de