Jump to content

Express Tools LISPS


Rooster

Recommended Posts

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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! :)

Link to comment
Share on other sites

Good luck! o:)

 

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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