Set Tag Leader Type to Free END

Hi ALL,

Is there a way to set up Leader Type to Free End?



I’m trying to place the tag into specific location, but since the leader is Attached End, it’s a little bit off.

Any ideas? Thanks.

BTW, using this script to place leader end to specific location. But this only works properly with free end leader.
import clr
clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import *

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.GeometryConversion)

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

items = UnwrapElement(IN[0])
points = UnwrapElement(IN[1])
elementlist = []

TransactionManager.Instance.EnsureInTransaction(doc)
for i in items:
	for p in points:
		try:	
			i.LeaderEnd = p.ToXyz()
			elementlist.append("Success")
		except:
			elementlist.append("fail")
TransactionManager.Instance.TransactionTaskDone()
OUT = elementlist

You can do something like this:

i.LeaderEndCondition = LeaderEndCondition.Free

https://www.revitapidocs.com/2020/0b0575d6-446d-d3e8-3ef7-12faed553b20.htm

Can’t see any errors after adding this to the script. Unfortunately, all the tags has the same ‘Attached End’ type. What am I doing wrong?

2020-03-24 12_54_40-Python Script

What if you try to change the leader end condition before you set the location of the leader end?

Already tried. Doesn’t work either.

Just saw that the script printing “fail”. Looks like something is not going through.

I suggest that you remove the try - catch block before debugging. Did you try without paranthesis after Endcondition.Free too? That should have given you an error.

Looks like I have successfully get rid of Attached End Type. Now it’s free end.
The problem was paranthesis after Endcondition.Free.

Thank you once again.

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

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.GeometryConversion)

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

items = UnwrapElement(IN[0])
points = UnwrapElement(IN[1])
elementlist = []

TransactionManager.Instance.EnsureInTransaction(doc)
for i in items:
	for p in points:
		try:	
			i.LeaderEndCondition = LeaderEndCondition.Free
			i.LeaderEnd = p.ToXyz()
			elementlist.append("Success")
		except:
			elementlist.append("fail")
TransactionManager.Instance.TransactionTaskDone()
OUT = elementlist
2 Likes