Move SectionView with given vector

Hi,

I’m having trouble moving sections bij a given vector. I’m making a script that duplicates a selected sectionview from a floor plan, and I’d like to move it as well by a given vector. This however gives every time Errors.. Anyone that can help?

Nico

Hello @fernandezP7VN2 and welcome to the forum :slight_smile: not 100 what you want exackly, can you show your graph, what you have tried so far ? one way maybe but not sure if it is you are after or more move the crop view maybe

Revit_XUjI0J4sLc

Yes this is what I want, but to then move the section in perpendicular direction. The problem I’m having still is that I don’t have the SOVI nodes, so I don’t know how to get the section line locations.

which revit version are in, if in 24 and guess 25 as well you can get location from genius loci get location node…but in 26 i dont think it works

but we can get the location with the view itself, with get the far clip offset handles as should be in center…thats how my dirty method works :wink:

Hmm okay. Essentially what I’m trying to do is to select a grid in Dynamo (lets say A) and get the corresponding sectionview with the name A. I also have a selection of other grids that are parallel to grid A and I want to duplicate view A, rename them to the corresponding grid they are going to and also move them in that direction with the corresponding distance.

Do you follow? :sweat_smile:

no not really, can you show your graph so far, and could probably bring light to my small brain :wink:

So what I want is to select grid A and also select all other grids that are parallel. I then want the section with the same name as the grid to duplicate, move to one of the other grids and be named the same as the grid it is going to

thanks but try zoom in the image How to export a graph image [Correctly] and share your python script…anyway how then just create a section and give it that name…

Yeah I know, but having this I could use it in any project I start, and I won’t be needing to rename it every time and give it the right View Template.

and Python node is:

import clr

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import \*

refGrid = UnwrapElement(IN\[0\])
grids = UnwrapElement(IN\[1\])

if isinstance(refGrid, list):
    refGrid = refGrid\[0\]

# -------------------------------------------------
# Referentie
# -------------------------------------------------
refCurve = refGrid.Curve
refPt = refCurve.Evaluate(0.5, True)

gridDir = refCurve.Direction.Normalize()

# Loodrechte richting in XY
normalDir = XYZ(-gridDir.Y, gridDir.X, 0).Normalize()

# -------------------------------------------------
# Bepaal dominante as (X of Y systeem)
# -------------------------------------------------
absX = abs(gridDir.X)
absY = abs(gridDir.Y)

if absX > absY:
    dominantAxis = "X-aligned grids -> offsets in Y"
    axisMode = "Y"
else:
    dominantAxis = "Y-aligned grids -> offsets in X"
    axisMode = "X"

# -------------------------------------------------
# Outputs
# -------------------------------------------------
names = \[\]
signedDistancesMM = \[\]
vectorsMM = \[\]
axisType = \[\]

for g in grids:

    pt = g.Curve.Evaluate(0.5, True)

    vec = pt.Subtract(refPt)

    # signed distance (loodrecht op grid A)
    signedDistanceFt = vec.DotProduct(normalDir)
    signedDistanceMM = signedDistanceFt \* 304.8

    # vector mm
    vecMM = XYZ(
        vec.X \* 304.8,
        vec.Y \* 304.8,
        vec.Z \* 304.8
    )

    # bepaal of beweging X of Y dominant is
    if axisMode == "X":
        axis = "X"
    else:
        axis = "Y"

    names.append(g.Name)
    signedDistancesMM.append(round(signedDistanceMM, 1))
    vectorsMM.append(vecMM)
    axisType.append(axis)

OUT = names, signedDistancesMM, vectorsMM, axisType, dominantAxis

Hi @fernandezP7VN2 probably me, but couldnt just create the sections work then
Revit_GmsRISBizx