BuildingPad in Python Script


#1

Hi, how do i create a BuildingPad inside Python Script? (No design script)

-I can create walls using Wall.Create(Parameters)

-or Floors using doc.Create.NewFloor(Parameters)

-0r an family object using doc.Create.NewFamilyInstance(parameters).

But i cant find a way to create a building pad, anyone have a clue?

Thanks <span style=“color: #ffffff;”><b>a</b></span>

<span style=“color: #ffffff;”><b>fa</b></span>


Placing Building Pads in Revit using dynamo
#2

Try the “Autodesk.Revit.DB.Architecture.BuildingPad.Create()” method


#3

This works thanks but i’m having trouble getting the buildingPadTypeId from a name i got, you have any tips?

I tried this just to see if the code works: FilteredElementCollector(doc).OfClass(BuildingPadType).ToElements() got the first element and used it this way
t.GetTypeId(). Example: Autodesk.Revit.DB.Architecture.BuildingPad.Create(doc,t.GetTypeId(),levelObj,listCurvedLoops)

But it still i got the error :

Exception: The buildingPadTypeId is not a valid type id for a BuildingPad.
Parameter name: buildingPadTypeId

And even if it worked i dont find a way to get the especific BuildingPadType Id from only the name i got from excel.

Thanks for your time again Dimitar


#4

I got it working now just passed Autodesk.Revit.DB.Architecture.BuildingPad.Create(doc,t,levelObj,listCurvedLoops) instead of Autodesk.Revit.DB.Architecture.BuildingPad.Create(doc,t,levelObj,listCurvedLoops) but i’m having trouble getting the especific one by name.

When i FilteredElementCollector to get Walls or Levels i have the object.Name to compare, now the FilteredElementCollector passing BuildingPadType as a class dont have a .Name propertie ( the documentation say it should have ), so how do i approach it?


#5

Hi Marcello,

You could try using Dynamo’s equivalent of a FEC instead:

2015-09-08_10-06-05


#6

Do you know how could i replicate the two first DS nodes, “Element Types” and “All Elements of Type” on the Python Script?


#7

I don’t believe there is one unfortunately. But you could use a FEC, wrap each element and query the dynamo name property.


#8

By FEC do you mean the FilteredElementCollector? If so does it only search for elements that are in the doc, the ones that i have at least one plotted ? (Not all the ones that are available for me to use )


#9

There are a lot of different FEC options. Some of them can work for element types and some of them only for placed instances. A really good article for most of the available options is the building coder as usual:

Also remember that you can always grab the first available type and then change it afterwards through dynamo. :slight_smile:


#10

Thanks Dimitar, you helped a lot : )