Cylis0509 Posted January 11, 2016 Share Posted January 11, 2016 Hi everyone, I have a drawing with a ton of leaders and text received from an outside source. I need to change the drawing orientation to a different rotation. By doing this all the text is obviously rotated to a different orientation. I am trying to take all the leaders and text and combine them into mleaders, I can do this using LeaderToMleader.lsp and it works great. What I am trying to add to it is a another LISP that then rotates the mtext based on the snap angle. This LISP also works, but what I really want to do is combine the two. As of now I have to run one then the other. Ideally I would like to combine them into one LISP. I have tried many different things but not matter what I do I always end up with an error stating too many arguments. Can anyone help? The LISPs are below... ;;; CADALYST 08/08 www.cadalyst.com/code ;;; Tip 2305: LeaderToMleader.lsp Leader to Multileader (c) 2008 Lyle Hardin ;;; Pick an old style leader and text to create a new mleader entity and erase the old leader and text. ;;; March/2008 (defun c:leadertomleader () (setq leader (entsel "\nPick Leader") ; pick leader leader2 (entget (car leader)) pt1 (dxf 10 leader2) ; get first point of leader layer (dxf 8 leader2) ; get layer of leader mtext (entsel "\nPick Text") ; pick text mtext2 (entget (car mtext)) pt2 (dxf 10 mtext2) ; get point of text text (dxf 1 mtext2) ; get ) ; setq (command "-layer" "s" layer "") ; set layer of leader picked to current (command "mleader" pt1 pt2 text) ; start mleader command (COMMAND "ERASE" mtext "") ; erase text picked (command "erase" leader "") ; erase leader picked ) ; defun (defun dxf(code elist) ; define dxf function (cdr (assoc code elist)) ;Finds the association pair, strips 1st element );defun (defun c:MLRO (/ ss ang i sset) (vl-load-com) (defun *error*() (setvar "nomutt" 0) ) (if (and (progn (setvar "nomutt" 1) (setq ss (ssget '((0 . "MULTILEADER")))) (setvar "nomutt" 0) (princ) ) (setq ang (getvar "snapang")) ) (repeat (setq i (sslength ss)) (setq sset (ssname ss (setq i (1- i)))) (vla-put-TextRotation (vlax-ename->vla-object sset) ang) ) (princ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
Cylis0509 Posted January 13, 2016 Author Share Posted January 13, 2016 No one huh? I am really stumped on this one, any help would be greatly appreciated. Thanks in advance... Quote Link to comment Share on other sites More sharing options...
broncos15 Posted January 13, 2016 Share Posted January 13, 2016 No one huh? I am really stumped on this one, any help would be greatly appreciated. Thanks in advance... I would just add the L filter with ssget and then put the code after your create the multileader. Ie: (setq ss (ssget "_L")) instead of (setq ss (ssget '((0 . "MULTILEADER)))) Quote Link to comment Share on other sites More sharing options...
Cylis0509 Posted January 13, 2016 Author Share Posted January 13, 2016 So I did your suggestion and it seems to be working. I swear I tried that already, very strange. But thank you very much!! Quote Link to comment Share on other sites More sharing options...
broncos15 Posted January 13, 2016 Share Posted January 13, 2016 No worries, I'm glad I could help. Quote Link to comment Share on other sites More sharing options...
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.