Lee Mac 发表于 2022-7-6 14:49:51

-- Vla-AddText ~ Justific

I have used "VLA-AddText" in the past, but there seems to be no input for a choice of justification for the text you are trying to create.
 
The text seems to always be created with a justification of bottom-left.
 
What is the easiest way to change the justification of such text? if indeed it can be changed?
 
As always, I thank you all for your time and patience
 
Cheers
 
Lee

Se7en 发表于 2022-7-6 14:58:30

(vla-put-attachmentPoint (vlax-ename->vla-object (car (entsel))) acAttachmentPointMiddleLeft)

Lee Mac 发表于 2022-7-6 15:09:11

Thanks John,
 
I see that works with MText only - out of interest, is there an equivalent for DTEXT?
 
Cheers
 
Lee

Se7en 发表于 2022-7-6 15:15:46

Not sure. I'll have to look.

Lee Mac 发表于 2022-7-6 15:27:46

 
Cheers, I appreciate your time
 
The only other method I have used in this respect is to move the text using a vector obtained from a point on the edge or the center of the box generated by the (textbox) function. - which is a bit of a hassle...

Se7en 发表于 2022-7-6 15:38:28

Looks like a pain; i think what you have to do is to:
Change the alignment point (Once you do this your text insertion point gets reset to 0,0 or something like that)
then you need to put the text back into position.
like:

(vla-put-AlignmentacAlignmentMiddle)(vla-put-TextAlignmentPoint(vlax-3d-point '))
 
There has to be a better way. I'll keep looking.

Se7en 发表于 2022-7-6 15:48:43

?

( (lambda (/)   (setq      (vlax-ename->vla-object (car (entsel)))          (vla-get-insertionpoint ))   (vla-put-AlignmentacAlignmentMiddle)   (vla-put-TextAlignmentPoint)) )

Lee Mac 发表于 2022-7-6 15:58:15

Ahh I see - like having to specify the 11 DXF group code when 72 & 73 are non-zero.
 
That looks like a better method than what I was peviously doing - thanks John.
 
Lee
页: [1]
查看完整版本: -- Vla-AddText ~ Justific