Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

vla-put-AttachmentPoint for Mtext

9 REPLIES 9
Reply
Message 1 of 10
Anonymous
1231 Views, 9 Replies

vla-put-AttachmentPoint for Mtext

I crate an MTEXT passing the poit which I need to be the MiddleCentered, but
it uses it as the corner point.
Then I assign the value to Vla-put-AttachmentPoint trying to transform the
point to become the MiddleCentered but it doesn't.
How can I do it?

Thanks
9 REPLIES 9
Message 2 of 10
Anonymous
in reply to: Anonymous


You need a (71 . 5) dotted pair in the entity data
for Middle Center justification -- the 5 is the value for MC [1 is for TL,
through 9 for BR].  You can build that in with (entmake), or put it in
with (subst) and (entmod), but I don't know how to do it with (vla-...)
functions.
--
Kent Cooper

 

 

"Gustavo_Guidi" wrote...
I crate an MTEXT passing the poit which
I need to be the MiddleCentered, but
it uses it as the corner point.
Then
I assign the value to Vla-put-AttachmentPoint trying to transform the
point
to become the MiddleCentered but it doesn't.
How can I do
it?

Thanks
Message 3 of 10
devitg
in reply to: Anonymous



Did you try to put it to 5

or

acAttachmentPointMiddleCenter



as per acad help



AttachmentPoint property [ActiveX and VBA Reference: AAR]


Specifies the attachment point for an MText object.



See Also | Example



Signature



object.AttachmentPoint



object



MText

The object or
objects this property applies to.



AttachmentPoint



acAttachmentPoint enum; read-write



acAttachmentPointTopLeft



acAttachmentPointTopCenter



acAttachmentPointTopRight



acAttachmentPointMiddleLeft



acAttachmentPointMiddleCenter



acAttachmentPointMiddleRight



acAttachmentPointBottomLeft



acAttachmentPointBottomCenter



acAttachmentPointBottomRight



Remarks

Message 4 of 10
Anonymous
in reply to: Anonymous


Hi Guido,

 

Things are slightly more complicated. From the
help:

 

"When the AttachmentPoint property is changed, the
position of the existing bounding box does not change, the text is simply
rejustified within the bounding box. However,
the InsertionPoint
property reflects the
coordinates of the attachment point being used, so the value of the
InsertionPoint property will change to reflect the change in
justification."

 

So what it take is:

 


1) Grab the original insertion point before
changing tha AttachementPoint

2) Get the bounding box of the Mtext and find the
MC point

3) Move the Mtext from the computed MC on the old
insertion point

 

I think that (trans...)
function is necessary to insure proper behaviour for reference
system other than WCS.

 

HTH

 

 

I crate an MTEXT passing the poit
which I need to be the MiddleCentered, but
it uses it as the corner
point.
Then I assign the value to Vla-put-AttachmentPoint trying to transform
the
point to become the MiddleCentered but it doesn't.
How can I do
it?

Thanks
Message 5 of 10
Anonymous
in reply to: Anonymous


I would consider that a good reason to use (subst)
with the (assoc 71) value in the entity data, rather than use those
properties.  That will leave the Insertion Point (assoc 10) unchanged, and
spare you the effort of saving the Insertion Point, calculating the bounding box
and its midpoint, and moving the Mtext.  All you have to do is change
the justification code to 5.

--
Kent Cooper

 

 

"Some Buddy" wrote...


Hi Guido,

 

Things are slightly more complicated. From the
help:

 

"When the AttachmentPoint property is changed, the
position of the existing bounding box does not change, the text is simply
rejustified within the bounding box. However,
the InsertionPoint
property reflects the
coordinates of the attachment point being used, so the value of the
InsertionPoint property will change to reflect the change in
justification."

 

So what it take is:

 


1) Grab the original insertion point before
changing tha AttachementPoint

2) Get the bounding box of the Mtext and find the
MC point

3) Move the Mtext from the computed MC on the old
insertion point

....
Message 6 of 10
Anonymous
in reply to: Anonymous

Thanks to all.
I did a vla-move to the right point. The thing is like Some Buddy says, you
assign the attachment as a acAttachmentPointMiddleCenter but nothing
change. But I'm sure it should, or there must be a way without moving it,
becouse if it doesn't work here It works in VB??? and there, in VB, they can
not use (subst) (assoc).. nor any other lisp function

Thanks again

Gustavo




"Gustavo_Guidi" escribió en el mensaje
news:6079262@discussion.autodesk.com...
I crate an MTEXT passing the poit which I need to be the MiddleCentered, but
it uses it as the corner point.
Then I assign the value to Vla-put-AttachmentPoint trying to transform the
point to become the MiddleCentered but it doesn't.
How can I do it?

Thanks
Message 7 of 10
Anonymous
in reply to: Anonymous


Prego Gustavo,

 

And I don't think that things are different in
VB??? or VB, because that's the way how ActiveX is implemented on Mtext and no
matter how you turn it or what programming language you use, it comes to the
same reality (as a matter of fact, the quoted text that I've posted is from the
ActiveX and VBA Reference Help, since there is no help documentation for
VLA functionality).

 

And I even think that it has some kind of
logic in it. You assign the new AttachmentPoint as a
description of how the text is justified, not as
a physical point, in other words you say "the point for justifying this
text is in the Middle Center of the text"
. And so, the new
justification point (AttachmentPoint) forces the new insertion point. So if
you want your text justified it in relation with the initial insertion point,
you have to move it, move it, even if you like it or not
:)

 

Thanks to all.
I did a
vla-move to the right point. The thing is like Some Buddy says, you
assign
the attachment as a  acAttachmentPointMiddleCenter but nothing
change.
But I'm sure it should, or there must be a way without moving it,
becouse if
it doesn't work here It works in VB??? and there, in VB, they can
not use
(subst) (assoc).. nor any other lisp function

Thanks
again

Gustavo




"Gustavo_Guidi" <

href="mailto:g_e_guidi@yahoo.com.ar">
size=2>g_e_guidi@yahoo.com.ar
> escribió en
el mensaje

face=Arial size=2>news:6079262@discussion.autodesk.com

face=Arial size=2>...
I crate an MTEXT passing the poit which I need to be
the MiddleCentered, but
it uses it as the corner point.
Then I assign the
value to Vla-put-AttachmentPoint trying to transform the
point to become the
MiddleCentered but it doesn't.
How can I do
it?

Thanks
Message 8 of 10
Anonymous
in reply to: Anonymous


Some Buddy

 

I understand what you say, and I have to accept it
is that way, but what sounds strange for me is that with TEXT, if you assign the
new alignmet with   (vla-put-alignment .....)  it changes
automatically to the new alignment point that you want.  Seems that
AutoDesk has a hole or bug without a function for some entity like MTEXT that it
potentially stronger thant TEXT

 

 



style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

Prego Gustavo,

 

And I don't think that things are different in
VB??? or VB, because that's the way how ActiveX is implemented on Mtext and no
matter how you turn it or what programming language you use, it comes to the
same reality (as a matter of fact, the quoted text that I've posted is from
the ActiveX and VBA Reference Help, since there is no help
documentation for VLA functionality).

 

And I even think that it has some kind of
logic in it. You assign the new AttachmentPoint as a
description of how the text is justified, not
as a physical point, in other words you say "the point for justifying
this text is in the Middle Center of the text"
. And so, the new
justification point (AttachmentPoint) forces the new insertion point. So
if you want your text justified it in relation with the initial insertion
point, you have to move it, move it, even if you like it or
not 🙂

 

Thanks to all.
I did a
vla-move to the right point. The thing is like Some Buddy says, you
assign
the attachment as a  acAttachmentPointMiddleCenter but nothing

change. But I'm sure it should, or there must be a way without moving it,

becouse if it doesn't work here It works in VB??? and there, in VB, they
can
not use (subst) (assoc).. nor any other lisp function

Thanks
again

Gustavo




"Gustavo_Guidi" <

href="mailto:g_e_guidi@yahoo.com.ar">
size=2>g_e_guidi@yahoo.com.ar
> escribió
en el mensaje

face=Arial size=2>news:6079262@discussion.autodesk.com

face=Arial size=2>...
I crate an MTEXT passing the poit which I need to be
the MiddleCentered, but
it uses it as the corner point.
Then I assign
the value to Vla-put-AttachmentPoint trying to transform the
point to
become the MiddleCentered but it doesn't.
How can I do
it?

Thanks
Message 9 of 10
Anonymous
in reply to: Anonymous


I will check my self on this, I was not aware
of it. Thanks for pointing it out.


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">


Some Buddy

 

I understand what you say, and I have to accept
it is that way, but what sounds strange for me is that with TEXT, if you
assign the new alignmet with   (vla-put-alignment .....) 
it changes automatically to the new alignment point that you want. 
Seems that AutoDesk has a hole or bug without a function for some entity like
MTEXT that it potentially stronger thant TEXT

 

 



style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

Prego Gustavo,

 

And I don't think that things are different in
VB??? or VB, because that's the way how ActiveX is implemented on Mtext and
no matter how you turn it or what programming language you use, it comes to
the same reality (as a matter of fact, the quoted text that I've posted is
from the ActiveX and VBA Reference Help, since there is no help
documentation for VLA functionality).

 

And I even think that it has some kind of
logic in it. You assign the new AttachmentPoint as a
description of how the text is justified, not
as a physical point, in other words you say "the point for
justifying this text is in the Middle Center of the text"
. And so,
the new justification point (AttachmentPoint) forces the new insertion
point. So if you want your text justified it in relation with the initial
insertion point, you have to move it, move it, even if you
like it or not 🙂

 

Thanks to all.
I did a
vla-move to the right point. The thing is like Some Buddy says, you

assign the attachment as a  acAttachmentPointMiddleCenter but
nothing
change. But I'm sure it should, or there must be a way without
moving it,
becouse if it doesn't work here It works in VB??? and there,
in VB, they can
not use (subst) (assoc).. nor any other lisp
function

Thanks
again

Gustavo




"Gustavo_Guidi" <

href="mailto:g_e_guidi@yahoo.com.ar">
size=2>g_e_guidi@yahoo.com.ar
>
escribió en el mensaje

href="news:6079262@discussion.autodesk.com">
size=2>news:6079262@discussion.autodesk.com

size=2>...
I crate an MTEXT passing the poit which I need to be the
MiddleCentered, but
it uses it as the corner point.
Then I assign the
value to Vla-put-AttachmentPoint trying to transform the
point to become
the MiddleCentered but it doesn't.
How can I do it?

Thanks

Message 10 of 10
Anonymous
in reply to: Anonymous

Is CENTERMT the command you are looking for? set to "1" not "0"???

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

Post to forums  

Autodesk Design & Make Report

”Boost