UI Selection - PickBoxStyle not defined

Hi All,

Ive got a small headscratcher here with using the PickBox() selection method in the Revit API.
For some reason the PickBoxStyle is not recognised.
Have I missed loading a reference or is this something else?

Revit 2018
Dynamo 1.3.2

image

import clr

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

clr.AddReference)'RevitAPI')
from Autodesk.Revit.DB.Events import *

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager

doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

pickedBox = uidoc.Selection.PickBox(PickBoxStyle.Enclosing, "Select a box")

OUT=pickedBox

@Kulkul?
@Mostafa_El_Ayoubi?

Got it, had to be a bit more specific when creating the PickBoxStyle. :man_facepalming:

import clr
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager

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

uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

pboxS=Autodesk.Revit.UI.Selection.PickBoxStyle.Enclosing

pickedBox = uidoc.Selection.PickBox(pboxS, "Select a box")

OUT=pickedBox
2 Likes