Vertically Compound Wall - Adding Splits and Layers

Vertically Compound Wall - Adding Splits and Layers

ari.monteiro
Advocate Advocate
865 Views
4 Replies
Message 1 of 5

Vertically Compound Wall - Adding Splits and Layers

ari.monteiro
Advocate
Advocate

Hi,

 

I need to write code to vertically cut the layers of a wall, as shown in the video below:

https://www.youtube.com/watch?v=TRjB9sylTb4

 

I found in the API documentation the Autodesk.Revit.DB.CompoundStructure.SplitRegion () method, but I don't quite understand how I can use it.

 

I looked for code examples on how to use this method, but didn't find it.

 

Any Suggestions?

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

jeremytammik
Autodesk
Autodesk
Accepted solution

I searched the Internet for SplitRegion samples as well:

 

https://duckduckgo.com/?q=revit+api+%22splitregion%22

 

I did not find many examples, but here is one that looks pretty useful indeed to me:

 

https://csharp.hotexamples.com/examples/-/CompoundStructureLayer/-/php-compoundstructurelayer-class-...

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 5

jeremytammik
Autodesk
Autodesk

On closer examination, I discover that the sample I found is part of the Revit SDK:

 

  • .../SDK/Samples/CompoundStructure/CS/Command.cs

 

You should always search the Revit SDK before going anywhere else, you know.

 

The samples there are created and shared exactly for this purpose and no other!

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 4 of 5

ari.monteiro
Advocate
Advocate

Hi @jeremytammik !

 

I didn't really look at the SDK examples, but here in the forum. I'll remember to look at the SDK first next time! Good hint!

 

I will try to use the codes in the links you gave me.

 

Actually, I'm trying to solve my problem in Dynamo using a Python Script node.

 

But, I also know C# and my idea was to know how to solve my problem in C# and then transcribe the solution to Python in Dynamo.

 

Thank you!

 

Merry Christmas and Happy New Year, my dear! 🙂

0 Likes
Message 5 of 5

ari.monteiro
Advocate
Advocate

Hi @jeremytammik!

 

I used part of the logic you provided me last year.

 

https://csharp.hotexamples.com/examples/-/CompoundStructureLayer/-/php-compoundstructurelayer-class-...

 

But there was a question: is it possible to edit the split dimension programmatically (see figure)?

 

Split Wall Vertically.png

 

 

I need to change the material and dimension of the wall split.

 

I've already verified that I can access:
    1. Access Wall Regions = GetRegionIds ()
    2. The layer associated with region = GetLayerAssociatedToRegion ()
    3. Material associated with layer = SetMaterialId ()

 

How can I change the region dimension from RegionId?

 

I did not find in the API documentation a class for manipulating the region in the split wall context.

 

Thanks!

0 Likes