Jump to content

join mtext with leader


pmadhwal7

Recommended Posts

12 hours ago, dlanorh said:

OK. Attached are two lisps

 

assocMText2Leader.lsp

This lisp will find all Leaders and MText in layer "Coordinates" and attempt to match the MText to a Leader, where the Leader does not have an associated MText item.

It does this by comparing the insertion point of the MText with each corner of the Leaders Bounding Box and if it is within the fuzz factor it then associates this MText to the leader.

To run this lisp type "AMT2L"  Points to note. This does not join the two items, merely associates them.

 

Leader2MLeader2.lsp

This lisp converts the Leader to an Mleader. It creates an MLeader style "Coordinates" if this is not present in the drawing and then combines the Leader and Mtext into a new MLeader object in layer Coordinates. It deletes the old Leader and associated MText. To run this lisp type "L2ML". It will not process any leader without an associated MText

 

Both of these have been tested on the supplied Sample drawing only and are working correctly, although it is possible I've missed something obvious.

Leader2MLeader2.lsp 4 kB · 1 download assocMText2Leader.lsp 1.95 kB · 1 download

 I found this msg:

Command: AMT2L
6 Leaders Found : 0 MText Objects associated with Leaders

Link to comment
Share on other sites

12 hours ago, dlanorh said:

OK. Attached are two lisps

 

assocMText2Leader.lsp

This lisp will find all Leaders and MText in layer "Coordinates" and attempt to match the MText to a Leader, where the Leader does not have an associated MText item.

It does this by comparing the insertion point of the MText with each corner of the Leaders Bounding Box and if it is within the fuzz factor it then associates this MText to the leader.

To run this lisp type "AMT2L"  Points to note. This does not join the two items, merely associates them.

 

Leader2MLeader2.lsp

This lisp converts the Leader to an Mleader. It creates an MLeader style "Coordinates" if this is not present in the drawing and then combines the Leader and Mtext into a new MLeader object in layer Coordinates. It deletes the old Leader and associated MText. To run this lisp type "L2ML". It will not process any leader without an associated MText

 

Both of these have been tested on the supplied Sample drawing only and are working correctly, although it is possible I've missed something obvious.

Leader2MLeader2.lsp 4 kB · 2 downloads assocMText2Leader.lsp 1.95 kB · 2 downloads

 

2 point important:-

1- leader and mtext , must be in Coordinates layer.

2- leader end grip point and mtext grip point must be together. not ledaer grip up or mtext grip down, both must be meet . 

 

for me both are working perfectly.

 

Thank you very much sir,

Another big problem solve by cad tutor team.:excited:

 

Edited by Ish
Link to comment
Share on other sites

4 hours ago, Ish said:

 

2 point important:-

1- leader and mtext , must be in Coordinates layer.

2- leader end grip point and mtext grip point must be together. not ledaer grip up or mtext grip down, both must be meet . 

 

for me both are working perfectly.

 

Thank you very much sir,

Another big problem solve by cad tutor team.:excited:

 

 

1. Yes at present, If you want any leader or any mtext then remove the (8 . "Coordinates") from the relevant ssget filter.

2. Not quite, finding the mtext is controlled by the fuzz value, at present this is quite small 0.01 but you can change it, but be careful if it is too large it may pick up  the wrong MText.

 

 

  • Like 1
Link to comment
Share on other sites

4 hours ago, pmadhwal7 said:

Command: AMT2L
; error: bad argument type: numberp: (#<VLA-OBJECT IAcadLeader 0000023cf14e67e8> #<VLA-OBJECT IAcadLeader 0000023cf14e6898> #<VLA-OBJECT IAcadLeader 0000023cf14e5ce8> #<VLA-OBJECT IAcadLeader 0000023cf14e6948> #<VLA-OBJECT IAcadLeader 0000023cf14e75a8> #<VLA-OBJECT IAcadLeader 0000023cf14e61b8> #<VLA-OBJECT IAcadLeader 0000023cf14e6528> #<VLA-OBJECT IAcadLeader 0000023cf14e6058> #<VLA-OBJECT IAcadLeader 0000023cf14e5b88>)

 

 

Is this in a different drawing? If so provide a partial drawing so I can see what is going wrong, as you previously said this was working. Unfortunately I can't find a solution from just an error message.

Link to comment
Share on other sites

3 hours ago, dlanorh said:

 

1. Yes at present, If you want any leader or any mtext then remove the (8 . "Coordinates") from the relevant ssget filter.

2. Not quite, finding the mtext is controlled by the fuzz value, at present this is quite small 0.01 but you can change it, but be careful if it is too large it may pick up  the wrong MText.

 

 

it is possible to provide :-

select object:- message on command prompt, so that we can select one and multiple. rather than automatic.

Link to comment
Share on other sites

2 hours ago, Ish said:

it is possible to provide :-

select object:- message on command prompt, so that we can select one and multiple. rather than automatic.

 

MText , Leader or one each of MText and Leader? And which program, since the L2ML only selects leaders?

It shouldn't be a problem, I have a bit of time this evening.

Edited by dlanorh
  • Like 1
Link to comment
Share on other sites

1 minute ago, dlanorh said:

 

MText , Leader or one each of MText and Leader?

It shouldn't be a problem, I have a bit of time this evening.

Sir, same time remove (8 . "Coordinates") from the relevant ssget filter.  & the fuzz value, at present this is quite small 0.01 . increase little bit.

 

thanks.

Link to comment
Share on other sites

4 minutes ago, Ish said:

Sir, same time remove (8 . "Coordinates") from the relevant ssget filter.  & the fuzz value, at present this is quite small 0.01 . increase little bit.

 

thanks.

 

I still need to know if you want to select Leaders, Mtext or both?

Link to comment
Share on other sites

On 9/26/2019 at 5:46 PM, dlanorh said:

 

I still need to know if you want to select Leaders, Mtext or both?

both, sir, after select both than joint leader to mtext.

Link to comment
Share on other sites

Try the attached. This asks for a leader and an MText selection to get the layers involved and then will process every leader and MText in the selected layers. It will also ask you to set a fuzz factor as this may change in individual drawings.

 

 

assocMText2Leader.lsp

Edited by dlanorh
  • Like 1
Link to comment
Share on other sites

32 minutes ago, dlanorh said:

Try the attached. This asks for a leader and an MText selection to get the layers involved and then will process every leader and MText in the selected layers. It will also ask you to set a fuzz factor as this may change in individual drawings.

 

 

assocMText2Leader.lsp 2.2 kB · 0 downloads

SIR, MULTIPLE SECTION NOT WORKING, IT ONLY FOR INDIVIDUAL SELECTION.

SEE ATTACH IMAGE. SIR, FOR SELECTION METHOD.

THANKS 

MUTLIPLE SELECTION.JPG

Edited by Ish
MODIFY
Link to comment
Share on other sites

Quote

 

SIR, MULTIPLE SECTION NOT WORKING, IT ONLY FOR INDIVIDUAL SELECTION.

SEE ATTACH IMAGE. SIR, FOR SELECTION METHOD.

THANKS 

 

 

Please attach this drawing as a sample drawing (saved in AutoCAD 2010 format). I though I understood what you required, but I seem to have got it wrong.

 

Do you still require the Leader to MLeader part?

Does it need to work with the updated Attach MText to Leader lisp?

 

Link to comment
Share on other sites

12 hours ago, dlanorh said:

 

Please attach this drawing as a sample drawing (saved in AutoCAD 2010 format). I though I understood what you required, but I seem to have got it wrong.

 

Do you still require the Leader to MLeader part?

Does it need to work with the updated Attach MText to Leader lisp?

 

 for now, need only joint leader to mtext. mleader not require.

 

i attached here cad file as you request.

Leader joint to mtext.dwg

Link to comment
Share on other sites

OK. Attached is updated AMT2L lisp. This handles 4 of the 5 leaders in your drawing. The exception is a leader with an attachment point set to 1 where the others are set to 4. This can be compensated by setting the fuzz to 3, but the leader moves. It is possible to keep the leader as is and move the mtext. What would you like to do?

 

 

assocMText2Leader2.lsp

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

40 minutes ago, dlanorh said:

OK. Attached is updated AMT2L lisp. This handles 4 of the 5 leaders in your drawing. The exception is a leader with an attachment point set to 1 where the others are set to 4. This can be compensated by setting the fuzz to 3, but the leader moves. It is possible to keep the leader as is and move the mtext. What would you like to do?

 

 

assocMText2Leader2.lsp 2.21 kB · 0 downloads

wow, exactly the same what i want.

Thanks -Dlanorh Rising Star

Link to comment
Share on other sites

On 9/29/2019 at 3:19 PM, dlanorh said:

OK. Attached is updated AMT2L lisp. This handles 4 of the 5 leaders in your drawing. The exception is a leader with an attachment point set to 1 where the others are set to 4. This can be compensated by setting the fuzz to 3, but the leader moves. It is possible to keep the leader as is and move the mtext. What would you like to do?

 

 

assocMText2Leader2.lsp 2.21 kB · 3 downloads

THANKS SIR assocMText2Leader2 WORKING

Link to comment
Share on other sites

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