Ish Posted September 26, 2019 Posted September 26, 2019 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 Quote
Ish Posted September 26, 2019 Posted September 26, 2019 (edited) 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. Edited September 26, 2019 by Ish Quote
dlanorh Posted September 26, 2019 Posted September 26, 2019 4 hours ago, pmadhwal7 said: AMT2L working but Command: L2ML Oops an Error : Automation Error. Description was not provided. occurred. Attached is updated L2ML Leader2MLeader2.lsp Quote
dlanorh Posted September 26, 2019 Posted September 26, 2019 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. 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. 1 Quote
dlanorh Posted September 26, 2019 Posted September 26, 2019 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. Quote
Ish Posted September 26, 2019 Posted September 26, 2019 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. Quote
dlanorh Posted September 26, 2019 Posted September 26, 2019 (edited) 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 September 26, 2019 by dlanorh 1 Quote
Ish Posted September 26, 2019 Posted September 26, 2019 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. Quote
dlanorh Posted September 26, 2019 Posted September 26, 2019 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? Quote
Ish Posted September 28, 2019 Posted September 28, 2019 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. Quote
dlanorh Posted September 28, 2019 Posted September 28, 2019 (edited) 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 September 28, 2019 by dlanorh 1 Quote
Ish Posted September 28, 2019 Posted September 28, 2019 (edited) 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 Edited September 28, 2019 by Ish MODIFY Quote
dlanorh Posted September 28, 2019 Posted September 28, 2019 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? Quote
Ish Posted September 29, 2019 Posted September 29, 2019 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 Quote
dlanorh Posted September 29, 2019 Posted September 29, 2019 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 1 2 Quote
Ish Posted September 29, 2019 Posted September 29, 2019 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 Quote
pmadhwal7 Posted October 4, 2019 Author Posted October 4, 2019 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 Quote
Seth Wells Posted July 31 Posted July 31 On 9/26/2019 at 5:17 AM, 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. Do you still have this lisp? I'm trying to create something similar but I wanted to see how you approached it. The lisp that was previously uploaded is currently unavailable for download. Quote
pkenewell Posted August 6 Posted August 6 On 7/31/2024 at 10:35 AM, Seth Wells said: Do you still have this lisp? I'm trying to create something similar but I wanted to see how you approached it. The lisp that was previously uploaded is currently unavailable for download. The download worked fine for me in the last post. I recommend you check things on your end, i.e. browser, permissions, cache, etc. Quote
Recommended Posts
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.