SetProjectionLinePatternId

Hello,
I have a problem with command “SetProjectionLinePatternId”. When I try to feed my python script with Id as int, I got a message “expected ElementId, got Int64”. How should I give “Id” to this command? (Int, string, pattern element doesn’t work).

I had a similar problem with color, but I created my color in python using: color = Autodesk.Revit.DB.Color(cRed, cGreen, cBlue).

Should I use similar method for PatternId?

Regards,
Konrad

You need to explicitly cast the Int64 to an ElementId. You will need references to Autodesk.Revit.DB.ElementId

import clr
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import ElementId

And then when using an id, wrap it with ElementId()

id = ElementId(intToConvert)

3 Likes

Thank you very much! It works. :slight_smile:

Best regards,
Konrad

1 Like