Questions about creating columns in the project document

Questions about creating columns in the project document

Anonymous
Not applicable
755 Views
4 Replies
Message 1 of 5

Questions about creating columns in the project document

Anonymous
Not applicable

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?

KakaoTalk_20200605_101532455.jpg

 

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!

0 Likes
Accepted solutions (1)
756 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable

Ah, for avoiding confusion, my drawing is the top view.

0 Likes
Message 3 of 5

RPTHOMAS108
Mentor
Mentor
Accepted solution

BuiltInParameter.SCHEDULE_... may be duplicates in terms of value of other better named BIP's that exist for this. I don't believe I generally use these specific ones for placement of columns best to look with RevitLookup. You will find that columns are either:

Vertical: With location point placed on a level and having level params and level offset params for top and bottom.

Slanted: With location curve instead of location point.

 

1) By convention location point is generally centre of column but it depends on the intersection of the reference planes that define the origin within the family.  So it is impossible for anyone to tell you what point your rectangle is rotating about although I suspect it shouldn't be the corner.

 

2) You can create direct shapes / free form elements but you should avoid this for such simple representations as vertical rectangular extrusions. You would be going away from the parametric nature of Revit. Providing no information to a BIM stakeholder to determine what your extruded 3D rectangle is (other than it's category).

 

You may also find that you need to complete a subtransaction or regenerate the document after placing the column and prior to rotating it if you are using a column location point as the origin for rotation (LocationPoint.Rotate). Generally the location point information is updated from 0,0 subsequent to placement. This doesn't appear to be what you are doing in this instance but it is something that has caught me out in the past.

0 Likes
Message 4 of 5

Anonymous
Not applicable

Thank you so much! I shouldn't have used center point.

0 Likes
Message 5 of 5

Anonymous
Not applicable

shouldn't have used --> should have used

0 Likes