Hi,
In Revit as a user we can create line with offset value. I want to achieve the same through API.
Is it possible? then how can we achieve that?
Thanks,
Solved! Go to Solution.
Solved by Joe.Ye. Go to Solution.
You can use the command Line.CreateBound(startpoint, endpoint)
startpoint and endpoint are XYZ objects where you put the coordinates of a vector, so in the Z coordinates you choose your offset.
It will be somthing like:
Dim startpoint As Autodesk.Revit.DB.XYZ
Dim endpoint As Autodesk.Revit.DB.XYZ
Dim line As Autodesk.Revit.DB.Line
startpoint = New Autodesk.Revit.DB.XYZ(0, 0, 10)
endpoint = New Autodesk.Revit.DB.XYZ(2, 2, 10)
line = Line.CreateBound(startpoint, endpoint)
This will create a line from coordinates (0, 0) to (2, 2) with base offset of 10.
Hope it helped
Bye
Hi,
You may want to, for a given line, get the location curve, then clone this curve, call a move on it passing the offset you need, then use this cloned-moved curve to create a new one...
Does that help?
Joe,
I can create an offset with the CopyElement just fine, the problem I'm having is figuring out which way the vector should go when drawing a wall horizontally on the screen, versus vertically or at an angle. I have a feeling it might be something in the Transform class, but i don't understand that very well. Essentially when creating a wall it defaults to the centerline. I would like it to move 1/2 the width to the Finish face. Any help you can provide is greatly appreciated. Thanks!