Steven P Posted November 28, 2023 Posted November 28, 2023 I am making a guess here that you are not an expert in LISPs, but what are your abilities, how much guidance will you need? For example for a MLeader the entity definition uses DXF codes 12 for the text positioning and 304 for the text itself, you can use these to get the values you need (defun c:ML ( / MyLeader MyText MyPosition ) (setq MyLeader (entget (car (Entsel "Select Multileader")))) (setq MyText (cdr (assoc 304 MyLeader))) (setq MyPosition (cdr (assoc 12 MyLeader))) (princ "\n Leader Text: ") (princ MyText) (princ "\n Text Inserted at: ") (princ MyPosition) (princ) ) If you do this with a multiple line text string you'll notice that '\P' appears in the command line in a single line of text, this is the new line character, and if it was me I'd use Lee Macs String to List function, (use an internet search), split the string into a list and recombine afterwards removing the line you don't want. Final thought is I would make up 1 routine to do all the work and 3 more that use that routine, for example MLRemLL (Multileader Remove Leader Line), MLRemL1, MLRemL2, MLRemL3 (multileader remove text lines 1, 2, 3) - slightly quicker to operate that way that is all. Final thought to remove the Multileader line I would just delete it and insert a new text string using the Mytext and MyPosition you found earlier However I suspect this is more than you wanted to do - have a go though but happy to do an example and also as hosneyalaa, also post an example drawing, perhaps a before and after. Quote
XDSoft Posted December 2, 2023 Posted December 2, 2023 (edited) No need to delete, just hide, you can restore the display at any time Methods provided by ARX: AcDbMLeader::setLeaderLineTypeC++ Acad::ErrorStatus setLeaderLineType( AcDbMLeaderStyle::LeaderType leaderLineType ); Description Sets the leader line type. Returns Acad::eOk if successful. Parameters Parameters Description leaderLineType Input the leader line type. Just implement it using LISP [XDrX-PlugIn(24)] Hide (show) leaders of Mleader objects in batches (theswamp.org) http://www.theswamp.org/index.php?topic=58823.0 Edited December 2, 2023 by XDSoft Quote
baigtime Posted January 16 Author Posted January 16 (edited) Thanks a lot! It's good, but I need to remove the [1st/2nd/3rd] line, which is the 'mtext' line. Thanks again! Edited January 16 by baigtime Quote
BIGAL Posted January 16 Posted January 16 Have a look at this. https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/remove-line-from-all-mtext/td-p/12464412 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.