Jump to content

-- Vla-AddText ~ Justification Question --


Recommended Posts

Posted

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 :oops:

 

Cheers

 

Lee

Posted

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

Posted

Thanks John,

 

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

 

Cheers

 

Lee

Posted
Not sure. I'll have to look.

 

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... :geek:

Posted

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-Alignment <txtobj> acAlignmentMiddle)

(vla-put-TextAlignmentPoint <txtobj> (vlax-3d-point '<someptlist>))

 

There has to be a better way. I'll keep looking.

Posted

?

( (lambda (/ <txtobj> <someptlist>)
   (setq <txtobj>     (vlax-ename->vla-object (car (entsel)))
         <someptlist> (vla-get-insertionpoint <txtobj>))
   (vla-put-Alignment <txtobj> acAlignmentMiddle)
   (vla-put-TextAlignmentPoint <txtobj> <someptlist>)) )

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...