0

I want to change the height of all walls but the length of walls only in a particular axis, for instance, along the x-axis.

Consecutively, could you also tell how I could alter the similar dimensions for a house? Where there are connected walls?

sadman
  • 21
  • 3

1 Answers1

0

I see nothing in this code that means it does not work.

However, it seems to me that it does not make much sense.

One would seldom constrain all wall heights to be user defined to a certain value; instead, in most Revit models, walls are constrained to reach from a bottom level to a top level. Then, if the height of all walls needs to be modified, you would modify the elevation of the top level only.

The logic of the code guarantees that the wall location line will only be modified if the newWallLine equals XYZ.BasisX. This may never be the case, since the line is a Line object and the vector an XYZ.

I would recommend researching exactly what you wish you achieve and how to do so manually in the end user interface before addressing the task programmatically.

In general, if a feature is not available in the Revit product manually through the user interface, then the Revit API will not provide it either.

You should therefore research the optimal workflow and best practices to address your task at hand manually through the user interface first.

To do so, please discuss and analyse it with an experienced application engineer, product usage expert, or product support.

Once you have got that part sorted out, it is time to step up into the programming environment.

I hope this clarifies.

Jeremy Tammik
  • 7,333
  • 2
  • 12
  • 17
  • Hello, Thanks for taking the time to reply. Assuming I never wrote the code, would you tell me if it's possible to select and edit the dimensions of the walls in a building in a particular axis only? If it is possible, would you please tell me how to achieve that? Thank you. – sadman Apr 02 '21 at 19:17
  • Yes, of course. However, it is probably easier to delete the existing walls and create new ones instead. Revit might produce warnings and errors when you modify existing walls in this way, since the connections between the existing walls will be lost when their length changes. What speaks against creating new walls from scratch? Cf., https://thebuildingcoder.typepad.com/blog/2017/11/automatic-wall-creation.html – Jeremy Tammik Apr 04 '21 at 04:25