Modify Model Lines of an Existing Floor Slab

Modify Model Lines of an Existing Floor Slab

avpBS7DE
Contributor Contributor
1,164 Views
4 Replies
Message 1 of 5

Modify Model Lines of an Existing Floor Slab

avpBS7DE
Contributor
Contributor

Dear Revit API,

I need to change the borders of a Floor Slab automatically. The ID of the element should not change (I can't delete / recreate another Floor). I tried to capture the underlying ModelCurves and change them but I get errors. I wonder, is it possible what I try to do and what is the best way ?

Thank you

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

Sean_Page
Collaborator
Collaborator

Unfortunately I do not believe this is possible at this time. You can create penetrations or openings in the floor, but not modify the actual boundary unless you recreate as you mentioned.

Sean Page, AIA, NCARB, LEED AP
Partner, Computational Designer, Architect
0 Likes
Message 3 of 5

RPTHOMAS108
Mentor
Mentor

You can make some basic changes to the underlying model lines within the sketch. I've recently used ElementTransformUtils.MoveElement successfully to offset a line. Probably the key is to ensure that the sketch remains joined up (when you move a line in the UI it drags the other joined lines with it). It may be possible to directly alter the geometry curve of a model line if you've ensured all the lines you are changing still join. I've not tested this and it would depend on when the check for a joined up sketch is undertaken (ideally upon transaction commit). You can only change one curve at a time and in the UI this is dealt with via a sketching context but in the API you just have model line elements.

 

So when you commit changes does it review the overall picture of the sketch or the changes of each model line in turn. If the commit looks at each model line change in turn (in relation to it's existing neighbours) then there will be a point where the new line information doesn't join with the existing line information (not yet updated). 

Message 4 of 5

so-chong
Advocate
Advocate
Accepted solution

Hi,

 

Did you find this blog post by Joe Ye?

 

https://adndevblog.typepad.com/aec/2013/10/change-the-boundary-of-floorsslabs.html 

 

Though this post is a bit outdated it still works in newer version of Revit.
Using the Revit Lookup tool to examine the Id of the element, Id remains the same after executing the code.

I hope you'll find it useful.

 

 

Message 5 of 5

avpBS7DE
Contributor
Contributor

Thanks So-Chong, that seem like a great post. 

I hadh done exactly that and reading the post encouraged me to look deeper into the problem again. 

As long as the model lines form a close loop again, then you can modify the floor. My mistake was something that some line wasn't connecting properly. 

0 Likes