I want to rotate or translate my entity, but its label cannot be moved together like an entity's sub entity. If there is no an easy way to implement this, I have got to create a point and then rotate or translate the point same way as the entity does and then dynamically create a new label based on that point. Is there another more direct and easier way?
Asked
Active
Viewed 172 times
1 Answers
0
Labels are defined for each Viewport. Maybe you can store the label's AnchorPoint to the entity's EntityData property and transform it according to the entity transformation.
var entity = model1.Entities[0];
entity.EntityData = model1.ActiveViewport.Labels[0].AnchorPoint;
var translation = new Translation(20, 30);
entity.TransformBy(translation);
((Point3D)entity.EntityData).TransformBy(translation);
model1.Entities.Regen();
model1.Invalidate();

ilCosmico
- 1,319
- 15
- 26