Pop up in window for sequence in routine

I’m working on a routine that performs several functions, and one depends on the completion of the other. However, I got to a part where to proceed I need to select faces. That is, I will create baseboards from some faces of specific rooms, and I can only do that after the floors are ready. Therefore, I need that in the middle of the routine in this part, a pop up appears in the window asking to select the faces, and then continue the routine. I made some attempts with the Data shapes package, but I still didn’t succeed. Does anyone know a better way or the correct way for this to happen?


Since you are creating geometry that you have to utilize later in the same graph, you will probably have to use transaction nodes instead of passthrough. However, some nodes are set to execute automatically when the run button is clicked and you won’t be able to control their execution time. So depending on what nodes you are needing to use, you may end up having to break up into two graphs. Attach your graph so we can take a look at it.

1 Like

I managed to do the selection routine, but after selecting I don’t know how to complete it. If I press enter, it gives an error and does not continue, and I also do not know how to link it with the configured category.


Automação completa2.dyn (174.2 KB)

This is similar to the Select Model Element node, except you can control when it’s executed by the input being set to true. If the input is false, it will pass a message “Set Input to True” and do nothing else. May need additional info on what you mean by linking with the configured category.

image

#Sometimes a pick selection is better
#Based on a node from Dimitar Venkov
#adapted by john pierson for rhythm
import clr

clr.AddReference("RevitAPIUI")
from  Autodesk.Revit.UI import *

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)

if IN[0] == 1:
	sel1 = uidoc.Selection
	ot1 = Selection.ObjectType.Element
	el_ref = sel1.PickObjects(ot1, "Select model elements")
	result = list()
	idlist = list()
	for i in el_ref:
	
		try:
			result.append(doc.GetElement(i.ElementId))
		except:
			result.append(list())
else:
	result = "Set Input to True"

OUT = result
2 Likes


I did not understand. Does it open a selection bar? Because it did not open, and did not allow the normal execution of the routine.

Strange. What is the error you are getting? Btw, with the way you have it set, it will execute when you run the script. If you want to delay it from running, then feed the true string through a passthrough and not the selected elements. Like below

1 Like

As I said, it doesn’t open any screen for selection, and it doesn’t actually do anything. Not in routine. It could also be that you are using the wrong node outputs and inputs. But it didn’t generate anything, just errors.
This routine works with reference lines, if you can, make a square with a reference line, select it in the first part of the routine and try to execute it to see.


Automação completa2.dyn (184.1 KB)

Oh yes, I understand. But a doubt, what do I have to do to make it continue after I make the selection of environments? Because I select it and I have to press something for it to execute, right? What would it be?

@Mostafa_El_Ayoubi
Could you tell us? The package works great, but I get stuck after making the selection because I don’t know how to tell it that it can complete.

The code uses the Revit select element method, so when it executes you should get the option of Finish and Cancel in the top left corner of the screen as shown below. When done selecting the element, click Finish.

image

2 Likes

I believe that @staylor says is the correct. You probably just have to click finish.
If you have a single selection to perform, you can set the “single selection” input of the node to true. It will resume the execution as soon as you pick your element, without waiting for you to hit finish.

1 Like

Wonderful, that’s right. Thanks for teaching me. Had not noticed.
However, I haven’t finished the routine yet, because it doesn’t look for the footer settings. I’m making the connections the wrong way, but I don’t know how. Could you check where the error is?

You can actually use the same select element node as previously provided and control that with the passthrough instead of using the datashapes. Also, looking at your last clip, you are getting an error because you are selecting a room instead of a surface. If that’s the case then you need to modify the code I provided above so you can select a face instead.

ot1 = Selection.ObjectType.Face
el_ref = sel1.PickObjects(ot1, "Select Face")
1 Like

I don’t understand. When I connect this part to the other parts of the routine, it doesn’t create the floors, and consequently it doesn’t create the faces, so I can’t make the baseboard. And even managing to select and confirm, it is not done.
I tried both with your code and with @Mostafa_El_Ayoubi nodes :weary:
Automação completa2.dyn (204.1 KB)

I went ahead and rearranged some things and it will create the floors. A lot of the passthroughs, dialog boxes and transactions are not needed, so I pushed them to the top. I can’t go beyond the point of creating the floor, because I don’t have a cad link in my model to select. Also, the last part “Room Footer”. It looks like you are trying to recreate walls from a selected surface. Not sure what this is for, but use the SelectFace node from Datashapes to select a surface. I included it, but didn’t attach it.

Automação completa2 (1).dyn (147.4 KB)

1 Like

Yes, I’m trying to create a baseboard, which I do with walls, on the surface of the others following their perimeter. Like the picture below. However, I manage to select, the routine works in a normal project, but in this routine it is still not working. I do not know why.
sem-titulo-1-11-1f828bf59c687eca1416521901357925-640-0

The routine does everything right, but when it comes time to generate, it gives these two errors


You are feeding the Was Run output into the surface node instead of the User Inputs. So that’s what’s causing the first error. The second error is probably just a residual of the first.

1 Like

Worse than it is, this was just another attempt, but I’ve tried countless times with the users output.
I believe I would have to find a node that replaces the selectmodelElementsData with one that makes curves for surfaces. For this is there as an element and there as a surface.
But I didn’t find it.

The surface perimeter curves node is looking specifically for a surface input. So use the Select.FacesData node instead of the SelectModelElementsData node and select the top surface of the floor instead of the actual floor.

1 Like

I’ve tried that too, still getting the error. :pensive: :pensive: :disappointed:

Can you provide the script for creating the baseboards that has worked for you in the other projects?

1 Like