Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Move tag to host location point.

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
garyntx
1282 Views, 2 Replies

Move tag to host location point.

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);
2 REPLIES 2
Message 2 of 3
jeremytammik
in reply to: garyntx

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

Message 3 of 3
Scott_Wilson
in reply to: garyntx

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)

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community