Jump to content

LISP TO REMOVE TEXT AND LEADER LINE OR ROW FROM MLEADER


Recommended Posts

Posted

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.

Posted (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

 

 

Rec 0005(2).gif

Edited by XDSoft
  • 1 month later...
Posted (edited)

Thanks a lot! It's good, but I need to remove the [1st/2nd/3rd] line, which is the 'mtext' line. Thanks again!image.png.8e2b19257c17a61d9840c166ef611857.png

Edited by baigtime

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