Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Wall Top Constraint Before Creation

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
454 Views, 3 Replies

Wall Top Constraint Before Creation

I have walls coming in through the API with the top constraint set to level 2 but I want it to be set to Unconnected. I have found how to do this after the wall was created but it leaves it at the height as if it was constrained to level 2. I was wondering if there was a way through the API to change the top constraint before the wall was created or revert it back to the shape of it's profile. Below is the code I'm using to change the top constraint.

 

newWall = Wall.Create(doc, profile, wall_type.Id, levelId, false, normal);

 

Parameter top_constraint_param = newWall.get_Parameter(BuiltInParameter.WALL_HEIGHT_TYPE);
top_constraint_param.Set("Unconnected");
top_constraint_param.SetValueString("Unconnected");
top_constraint_param.Set(ElementId.InvalidElementId);

Tags (2)
3 REPLIES 3
Message 2 of 4
sonicer
in reply to: Anonymous


what about use this.

 

Wall.Create(
	Document document,
	Curve curve,
	ElementId wallTypeId,
	ElementId levelId,
	double height,
	double offset,
	bool flip,
	bool structural)
Message 3 of 4
Anonymous
in reply to: sonicer

I believe this method would limit me to rectangular walls which I would like to avoid. Please correct me if I'm wrong.

 

More info: I don't have the issue if I use the default architecture template but I do if I use the default construction template. If I manually make a wall and take off the top constraint on it, it is no longer a problem after that. I would like to find a way to remove the top constraint through the API though so that all walls I import come in following the profile they are given.

Message 4 of 4
Anonymous
in reply to: Anonymous

The answer I posted in the top comment plus changing the height of the wall after seems to be working.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report