Rooster Posted December 11, 2008 Share Posted December 11, 2008 Why is it that if I use one of the Express Tools LISPS (eg MPEDIT or TXT2MTXT) on its own there is no problem, but when I try to run them from within another LISP or a script I get a message saying unknown command etc? Can I get round this? Quote Link to comment Share on other sites More sharing options...
David Bethel Posted December 12, 2008 Share Posted December 12, 2008 How are you trying to use them? Command: mpedit AutoCAD Express Tools Copyright © 1999 Autodesk, Inc. Initializing... Select objects: *Cancel* Command: !mpedit #<SUBR @08d688c0 MPEDIT> Command: (c:mpedit) Select objects: MPEDIT is an external autolisp subroutine. It can be called from another routine by evaluating the full defun name (c:mpedit) but it will take over control until it has completed it's evaluation. Code shown is from A2K -David Quote Link to comment Share on other sites More sharing options...
Rooster Posted December 17, 2008 Author Share Posted December 17, 2008 How are you trying to use them? One of the things I'm trying to do is create a text-capitalisation LISP, so rather than using TCASE and then selecting UPPERCASE from the pop-up window, I'd like to just be able to type CC (for example) and then select my text and for it to be capitalised without any further clicking or selecting. MPEDIT is an external autolisp subroutine. It can be called from another routine by evaluating the full defun name (c:mpedit) but it will take over control until it has completed it's evaluation. That helps a little. I'm not getting the 'Unknown Command' error any more, but I still can't get it to do what I want yet..... Quote Link to comment Share on other sites More sharing options...
borgunit Posted December 17, 2008 Share Posted December 17, 2008 http://www.cadtutor.co.uk/forum/showthread.php?t=494 Quote Link to comment Share on other sites More sharing options...
Rooster Posted December 17, 2008 Author Share Posted December 17, 2008 http://www.cadtutor.co.uk/forum/showthread.php?t=494 I can't see that that gets me any further - I already know about TCASE, but I'm just trying to refine it a bit to get it to work better for me. Thanks for trying though... Quote Link to comment Share on other sites More sharing options...
David Bethel Posted December 17, 2008 Share Posted December 17, 2008 If I understand correctly, you will have to rewrite the routines in order to fully automate the process. You cannot pass inputs into (get___) or (ssget) calls once another routine has taken over control. Sorry -David Quote Link to comment Share on other sites More sharing options...
Rooster Posted December 18, 2008 Author Share Posted December 18, 2008 If I understand correctly, you will have to rewrite the routines in order to fully automate the process. You cannot pass inputs into (get___) or (ssget) calls once another routine has taken over control. Sorry -David Shame. Nice idea though.... I will have to try rewriting as you suggest. Wish me luck! Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted December 18, 2008 Share Posted December 18, 2008 Wish me luck! Good luck! Quote Link to comment Share on other sites More sharing options...
Rooster Posted December 18, 2008 Author Share Posted December 18, 2008 Good luck! Hmm. I've just had a look at TCASE.LSP and it's way too complicated for me to try to edit with my limited LISP capabilities..... Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted December 18, 2008 Share Posted December 18, 2008 Hmm. I've just had a look at TCASE.LSP and it's way too complicated for me to try to edit with my limited LISP capabilities..... Does TCASE just change text to upper case? Quote Link to comment Share on other sites More sharing options...
dtkell Posted December 18, 2008 Share Posted December 18, 2008 Softdesk had a convcase.lsp that would allow you to pick your text and decide whether upper or lower. It was the precursor to tcase. Maybe this could be worked into your lsp. I don't know enough about lisp, other than how to use them, to be much help. The convcase.lsp is attached. convcase.lsp Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted December 18, 2008 Share Posted December 18, 2008 Another: (defun c:captxt () (if(setq ent1(entsel "Select Text: ")) ; user input (progn (if(setq ent2(car ent1)) ; selecting entity name (progn (setq enlist1(entget ent2)) ; getting entity DXF table (setq txtval2(cdr(assoc 1 enlist1))) ; acquiring text string 'assoc 1' (setq txtval2(strcase txtval2)) ; converting to capitals (setq enlist1(subst (cons 1 txtval2)(assoc 1 enlist1)enlist1)) ; substituting back in place of 'assoc 1' (entmod enlist1) ; modifying the DXF table (entupd ent2) ; updating the entity ) ; close progn function ) ; close 'if' function ) ; close progn function ) ; close 'if' function (princ) ; exit cleanly ) ; end of program Quote Link to comment Share on other sites More sharing options...
krautfed Posted December 19, 2008 Share Posted December 19, 2008 Sorry to threadjack, but I'm trying to do the same (use an express tool command inside another lisp). Is there a way I can crack open the command to see what is involved? FWIW - I'm a complete LISP newb and using this as a learning tool from LISP. I'm trying to create a shortcut for flattening a 3D polyline. I'm wanting to combine EXPLODE, FLATTEN, PEDIT (JOIN and LT gen) so that I can handle these nasty 3D polylines I get from DGN imports. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted December 20, 2008 Share Posted December 20, 2008 I also have interest in doing this, but how to get into the express tool lisp files.... 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.