Hi All,
I've been trying to modify the insertion point using both of these methods and nothing happens. Do I need to do something else after using vlax-put to update the object?
At the moment, I'm just passing
(vlax-put obj 'InsertionPoint '(0 0 0))
Where obj is a VLA-Object. And expecting the text to move, but nothing...
Thanks in advance
John
Ok,
I've found that I can change the insertion point of some of the text, but not all. The only difference that I can see is that if dxf group 11 is shown as (11 0.0 0.0 0.0), then I can modify the text (either by using vlisp or modifying group code 10). However, when 11 is anyhing but (11 0.0 0.0 0.0), the only way I can modify the inserction is by modifying group code 11??
Can anyone shed light on the difference between code 10 and 11? Is there a way of modifying the text entity so that it works in all cases (modifying 11 does not change the text when its (11 0.0 0.0 0.0))?
Thanks in advance and I hope i've explained the issue properly...
John.
@iwafb wrote:... I can change the insertion point of some of the text, but not all. ... if dxf group 11 is shown as (11 0.0 0.0 0.0), then I can modify the text (either by using vlisp or modifying group code 10). However, when 11 is anyhing but (11 0.0 0.0 0.0), the only way I can modify the inserction is by modifying group code 11??
Can anyone shed light on the difference between code 10 and 11? Is there a way of modifying the text entity so that it works in all cases (modifying 11 does not change the text when its (11 0.0 0.0 0.0))?
....
For Text entities, the 10 code location in the entity data is always the left end of the baseline, and it's also always stored in the InsertionPoint VLA property. It is also the insertion point that object snap goes to for left-justified Text only [left-justified is the default for regular Text, rather than, as alanjt said, top left, which is the default only for Mtext]. The 11 code location is also stored in the TextAlignmentPoint VLA property. For left-justified Text, that is always (11 0.0 0.0 0.0) [when in the drawing plane -- if it's got a non-zero Z coordinate, that will show up in the 11 code.] For any justification other than left, the 11 code is the object-snap insertion point and the InsertionPoint VLA property, and the 10 code is only a result of the size/shape of the overall entity in relation to that.
Because of those quirks, you need to do it differently for left-justified Text than for any other justification. I don't think there is any justification-independent way to do it, whether by entity data substitution or through VLA properties. You need to find the justification [which you can do in several ways], and depending on what you find, change the appropriate entry or property.
EDIT: The 10 code is also the object-snap insertion point if the justification is the more rarely-used Fit or Aligned, not only for Left.
@Kent1Cooper wrote:....you need to do it differently for left-justified Text than for any other justification. I don't think there is any justification-independent way to do it, whether by entity data substitution or through VLA properties. You need to find the justification [which you can do in several ways], and depending on what you find, change the appropriate entry or property. ....
For instance, if 'obj' is the Text entity as a VLA-object:
(vlax-put
obj
(if (= (vla-get-Alignment obj) 0); left-justified
'InsertionPoint ; then
'TextAlignmentPoint ; else
); if
YourNewLocation
); vlax-put
[That ignores the Fit and Aligned possibilities, since it would depend on what you would be wanting to do in those cases, if you would ever have them -- leave one point where it is and move the other, and if so, which? move the whole thing but leave it the same size and angle and so on? etc. Some possibilities would require changing both those properties.]
@Kent1Cooper wrote:.... For any justification other than left, the 11 code is the object-snap insertion point and the InsertionPoint VLA property, and the 10 code is only a result of the size/shape of the overall entity in relation to that.....
[The red part above is not true -- my mistake. As stated farther up in that same message, the 10 code location is in the InsertionPoint VLA property, and the 11 code is in the TextAlignmentPoint property.]
Thanks Kent,
As usual, your answers are etremely informative. I'm surprised Autodesk haven't included a link to your email in their help menu...
John