Message 1 of 4
How to retrieve Section View / elevation view Marker Current location from its location property (marker.Location)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to move the view markers (e.g. section view markers, or elevation view) in the active floor plan view to given the position. However, I am stuck at trying to find the marker current location then use the Location.Move(move_vector) method to move it to the new location which is determined by move_vector = (NewLocation.X -CurrentLocation.X, NewLocation.Y -CurrentLocation.Y,NewLocation.Z -CurrentLocation.Z). Please help advise on how to retrieve the current location of the marker or show a better way to achieve this?
#Revit Dynamo Python
import clr
import sys
sys.path.append('C:\Program Files (x86)\IronPython 2.7\Lib')
import System
from System import Array
from System.Collections.Generic import *
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
clr.AddReference("RevitAPI")
clr.AddReference("RevitAPIUI")
import Autodesk
from Autodesk.Revit.DB import *
from Autodesk.Revit.UI import *
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
uidoc = uiapp.ActiveUIDocument
#input
NewLocation=IN[0] # IN[0] XYZ(10,10,10)
#Collect all the markers
markers = FilteredElementCollector(doc, doc.ActiveView.Id).OfCategory(BuiltInCategory.OST_Viewers).WhereElementIsNotElementType().ToElements()
for markr in markers:
markr.Move(NewLocation) # this works but it moves the marker 10 unit on X, Y, Z respectively but not to Point(10,10,10). I would like to move it to Point(10,10,10))
OUT= "None"