
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, I have some questions about creating columns which are not parallel to X & Y axis.
To draw such columns, I wrote this code.
// Create a column at the location
Autodesk.Revit.DB.XYZ point1 = new Autodesk.Revit.DB.XYZ(location.X, location.Y, baseLevel.Elevation);
Autodesk.Revit.DB.XYZ point2 = new Autodesk.Revit.DB.XYZ(location.X, location.Y, topLevel.Elevation);
instance = doc.Create.NewFamilyInstance(point1, familySymbol, baseLevel, StructuralType.Column);
instance.get_Parameter(BuiltInParameter.SCHEDULE_TOP_LEVEL_PARAM).Set(topLevel.Id);
instance.get_Parameter(BuiltInParameter.SCHEDULE_TOP_LEVEL_OFFSET_PARAM).Set(0.0);
instance.get_Parameter(BuiltInParameter.SCHEDULE_BASE_LEVEL_OFFSET_PARAM).Set(0.0);
// Rotate the column around Z-axis
Line axis = Line.CreateBound(point1, point2);
ElementTransformUtils.RotateElement(doc, instance.Id, axis, rotation);
1. First, it adds a column to the project document then rotates the column by given radian.
So this code would work like the below drawing... (Sorry for bad drawing) Is my understading right?
2. Can I use rectangle profile(on XY plane) and level to add columns to project document? (Like NewExtrusion methods, but this is for the family document.)
There are lots of overloaded NewFamilyInstance methods, but I couldn't find like that.
One of the NewFamilyInstance methods takes Curve parameter, but in order to get rect profile information, parameter should be CurveArrArray, I think.
Thanks in advance!
Solved! Go to Solution.