Herr_Manu Posted April 5, 2022 Posted April 5, 2022 Hi everyone I'm trying to create a mleader to properly label the properties of some Plant 3D components, but i'm having some problems to set elevation of the mleader, given that mleader don't have an "elevation" Property to use vla-put. So far i tried with (trans p1 0 1) (trans p2 0 1) but everything ends up in the correct x and y coordinates but in z 0 (defun mleader (text) (if (and (setq p1 (getpoint "\nPick First Point: ")) (setq p2 (getpoint "\nPick Next Point: " p1)) ) (progn (setq obj (vlax-invoke (vlax-get (vla-get-ActiveDocument (vlax-get-acad-object)) (if (= 1 (getvar 'CVPORT)) 'PaperSpace 'ModelSpace );if );end of vlax 'AddMLeader (append p1 p2) 0 );end invoke );end setq obj (vla-put-textstring obj text) (vla-put-TextHeight obj 50) (vla-put-TextWidth obj 1300) );end of progn );end if (princ) );end defun mleader I'm looking forward to read the comments about this regard. i'm sure it will be really useful BTW, does anyone know why 'AddMleader after (append p1 p2) needs this extra 0 ???? Thanks a lot Quote
ronjonp Posted April 5, 2022 Posted April 5, 2022 2 hours ago, Herr_Manu said: Hi everyone BTW, does anyone know why 'AddMleader after (append p1 p2) needs this extra 0 ???? It's the leader index since an mleader can have multiple leaders. 2 Quote
BIGAL Posted April 6, 2022 Posted April 6, 2022 (edited) Removed misread post. Edited April 6, 2022 by BIGAL Quote
tombu Posted April 6, 2022 Posted April 6, 2022 I use Tharwat's lisp to label coordinates using XY, XYZ, or just Z with leader. Not sure what annotation you're looking for but this should be a good place to start. https://www.cadtutor.net/forum/topic/68126-require-lisp-3-in-1-for-xyz-coordinates-with-leader/?tab=comments#comment-552696 1 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.