Independent tag

Independent tag

DWhiteley
Advisor Advisor
2,974 Views
1 Reply
Message 1 of 2

Independent tag

DWhiteley
Advisor
Advisor

I'm having problems with creating an Independent tag.

var newtag = IndependentTag.Create(doc1, element.Id, view.Id, oRef, false, tagorn, elementXYZ);

 

And getting this error:

Capture.GIF

The element is a column. Does a tag have to be loaded in the api first even though one is available in the loaded model. If so, how do I load the tag?

Any help would be much appreciated.

Dave

0 Likes
Accepted solutions (1)
2,975 Views
1 Reply
Reply (1)
Message 2 of 2

aignatovich
Advisor
Advisor
Accepted solution

Hi!

 

This method requires tag family symbol id as the second parameter, not the id of the element you want to tag:

public static IndependentTag Create(
	Document document,
	ElementId symId, // <- here
	ElementId ownerDBViewId,
	Reference referenceToTag,
	bool addLeader,
	TagOrientation tagOrientation,
	XYZ pnt
)

If you use this method, you should find tag family symbol first, if it is not presented in the document, you should load it with document.LoadFamily method.