Sectionview mirroring (up and down)

I am working on a tool that make’s sheets based on connection points (details) and makes a 2d and 3d view of the view. The problem i am having is that my view is looking up instead of down this means my 2d views are mirrored (i think this is the problem) how can i make it that my 2d view is correctly displayed? This is what i have now it uses the bounding box min and max points to make a sort of scope box for the 2d view (the bounding box is used to make a 3d view and pushes the views on to 1 sheets.)


i already tried it by making the Z axis negative 1k height but that doesn’t work because it will pick the min and max point so it still looks the same
image

Would inverting the coordinate system by rotating it 180 degrees work? Something like this?

I tried it out but it does not seem to work, now i only get empty views but what i can see are the grids on the drawing almost as if it is a flat drawing with nothing on it.


it looks like when i punt it on rotating the Z axis it works but now the view scope is way off

this is the code now with rotating the ZAxis with the coordinatesystem.rotate

As the Z axis is vertical, rotating the coordinate system around that would probably translate the location in plan of the bounding box. Try rotating the CS around the X or y axis (so the resulting z axis, and I assume the view direction, is pointing down). Create a solid corresponding to your bounding box, I assume that you will find it is translated in space compared to what you expect- you will probably need to do some math on the bounding box coordinates as well to get them in the correct place in relation to the revised coordinate system. (hopefully only multiplying them by -1)

Joe

ah ok see what i did wrong i had to put the origin point of the section box in to get the correct view, but now i have a new problem beacose my new view does not want to take a viewtemplate correctly : (
the new code that works:


the error i have now:

is there maybe a way to only take the X and Y value of the Bounding box and use that to make a view by coordinatessystem so u does not look at the z axis (height)

Unfortunately, that error doesn’t tell us what’s wrong with the view template in relation to the view.

Try two things:

  • after the view is created by your script, just go into the view in Revit and try to apply the view template. Note any errors in Revit.
  • Try making a template that only has what you need as part of the defined template. For example, if all you care about is scale and what categories are visible, only check the boxes next to those values. There may be less chance of errors in that case.

Just found out i am dumb… there is another Node called sectionview.ByboundingBox this will create the views i wanted without needing min and max points. Now the viewtemplate will connect correctly, the final code:


Thnx for the help.

Not dumb, you just needed that one more little bit of info. Glad you figured it out, and I’m sure this thread will help someone in the future.

Joe