Hi there,
I am new to API and I am following a textbook to generate elevations from script. It works well but when I set the elevation to 10.0 it shows up as 3.408. No matter what value I entered, it is always a value reduced to 34.08%. So the only correct elevation is 0.0.
Is anybody aware what goes wrong with my code please?
Many thanks.
I am new to API and I am following a textbook to generate elevations from script. It works well but when I set the elevation to 10.0 it shows up as 3.408. No matter what value I entered, it is always a value reduced to 34.08%. So the only correct elevation is 0.0.
Is anybody aware what goes wrong with my code please?
Many thanks.
Code:
public Result Execute (ExternalCommandData commandData, ref string messages, ElementSet elements) { UIApplication uiApp = commandData.Application; Autodesk.Revit.ApplicationServices.Application app = uiApp.Application; Document doc = uiApp.ActiveUIDocument.Document; //Level level = Elements as Level; Level [] level = new Level[3]; using (Transaction transaction = new Transaction(doc)) { transaction.Start("Create Level"); level[0] = Level.Create(doc, 0.0); LevelType levelType = doc.GetElement(level[0].GetTypeId()) as LevelType; Parameter relativeBaseType = levelType.get_Parameter(BuiltInParameter.LEVEL_RELATIVE_BASE_TYPE); relativeBaseType.Set(1); level[1] = Level.Create(doc, 5.3); level[2] = Level.Create(doc, 10.0); transaction.Commit(); } }
Comment