Move tag to host location point.

Move tag to host location point.

Anonymous
Not applicable
1,494 Views
2 Replies
Message 1 of 3

Move tag to host location point.

Anonymous
Not applicable
Im trying to move a tag to the host location point. Can anyone show me what the syntax is to do this? I already have 'tag' and 'hostLocation' assigned. I've tried this but get an error: tag.Location = new LocationPoint(hostLocation.Point);
0 Likes
Accepted solutions (1)
1,495 Views
2 Replies
Replies (2)
Message 2 of 3

jeremytammik
Autodesk
Autodesk

You could try using the ElementTransformUtils.MoveElement or the Location.Move method instead.

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 3 of 3

Anonymous
Not applicable
Accepted solution

Jeremy is right, you need to use the Location.Move method. The trick though is knowing how far to move it as the tag's Location property can not be cast to either LocationPoint or LocationLine. You instead need to use the point returned by the TagHeadPosition property for the location of the tag.

 

you can then do something like:

 

tag.Location.Move(hostLocation - tag.TagHeadPosition)