Move text notes

Hi,

I am trying to move text notes in the z-direction, i found some scripts but it seems not to work with Cpython.

original
items = UnwrapElement(IN[0]).Id
xyz = UnwrapElement(IN[1]).ToXyz()

doesn’t work with .Id and .ToXyz at the end.

when line 30 active i get this error
afbeelding

Hi @EzDoesIt,

It is working with the Element SetLocation node from the Genius Loci package.

image

1 Like

Yes i know and i use them frequently😁 but it seems not work with CPython3
I just started with Python and would like to work with CPython3 as much as possible in the future

It works fine. Try feeding a single item for each of the inputs instead of lists containing a single item.

Generally speaking if you see an item not work I recommend checking it’s class, and/or pulli t the directory of calls you can make on it (OUT = dir(item)). If you did you’d see you have a list, which doesn’t have an Id property.

@EzDoesIt

I don’t know what your entry point means, but with DB.ElementTransformUtils.MoveElements() method you need to compute a vector at input (and not a list of point) and convert it with ToXyz() method extension

Ok i missed that completly, also still learning where to look.
but…

i got this error, i don’t know where to look or debug.

got it wrong ID

But element has not moved :unamused:

What was the vector? I am guessing (assuming a plan view) you want something restricted to the Y axis.

I am moving in a section in the Z-direction.

I was feeding the elements X and Y old coordinates and the new Z coordinate as a vector instead of only the distance to move in the Z-direction.

It was late yesterday and i didn’t check revit because i saw the “null” value as output in the node

Now going to work with lists

thanks to
@jacob.small
@c.poupin
@Alban_de_Chasteigner

1 Like

Hi,

I got it working with single and multiple input but i wonder if this is the correct way?

Personally I prefer ensuring everything is a list when I plan on accommodating them at all:

Another good learning exercise is moving each element by a different vector which you bring in at IN[1].

Thanks,

It is a bit busy right now, (i have to work also :blush:), but when i have a spare moment i certenly try the exercise.

1 Like

I know the feeling!

As a hint for when you get the chance: ZIP is your friend.

Hi,

Suddenly i got this error ‘Vector’ object has no attribute ‘ToXyz’ as fas i know i didn’t change anything

Try restarting Revit.

I restarted the computer still not working.

These are te attributes from the vector maybe this helps




Get rid of the .ToXyz() on line 12.
Comment out lines 14-27.
Make line 13 OUT = XYZ.__doc__, dir(xyz)


Looks like we missed an import for geometry conversion. Go back to base boilerplate imports at the top and see if that fixes it.

1 Like

@EzDoesIt

You need to import the extension module

See it

I think dir() method do not work in this case