Jump to content

LISP calling another LISP


Rooster

Recommended Posts

It all works fine for me, which command is it saying is unknown?

 

ok - i seem to have got it going without the error message now.

 

next problem (!): when i use the fts lisp within a script that i run, i use it to select all text with 'standard' text style (which is what fts does) and then change the text style of these to my own style like so:

FTS (enter)
ALL (enter)
(enter)
CHT (enter)
S (enter)
(enter)
LDS_TEXT (enter)

when running fts within this new lisp, how can i get it to do everything from 'ALL' onwards?

Link to comment
Share on other sites

  • Replies 31
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    12

  • Rooster

    8

  • Commandobill

    6

  • alanjt

    3

This will make FTS select all text items with Standard style:

 

(defun c:fts  (/ cSet)
 (if (setq cSet (ssget "_X" '((0 . "*TEXT") (7 . "Standard"))))
   (progn
     (princ (strcat "\n" (rtos (sslength cSet) 2 0) " found."))
     (sssetfirst nil cSet))
   (princ "\n<< Nothing found >>"))
 (princ))

(defun c:test ()
 (c:fts)
 (princ))

Link to comment
Share on other sites

This will make FTS select all text items with Standard style:

i thought it was already doing that? my problem was then in using the selection & changing it to a different text style as i would do in my script....

Link to comment
Share on other sites

i thought it was already doing that? my problem was then in using the selection & changing it to a different text style as i would do in my script....

 

In the previous posted version, the user would have to select the text items manually.

Link to comment
Share on other sites

In the previoud posted version, the user would have to select the text items manually.

 

ah - i see! thanks - i think that helps me with my next step. much appreciated as always, lee :)

Link to comment
Share on other sites

  • 1 month later...
untested, but this should work:

(defun c:TEST (/)
 (or c:SPL2PL (load "SPL2PL"))
 (vla-sendcommand
   (vla-get-activedocument
     (vlax-get-acad-object)
   ) ;_ vla-get-activedocument
   "SPL2PL all  0.1 "
 ) ;_ vla-sendcommand
 (princ)
) ;_ defun

 

 

I never thought it was possible...

 

Tested and works... let's automate all of our lisps.

Link to comment
Share on other sites

  • 4 years later...

Is there a way though to call another lisp command when the first lisp finishes or a way to make the lisp quit and call another one.

 

(Sorry to hijack the thread but there are several already with almost the exact same title...)

Link to comment
Share on other sites

call another lisp command when the first lisp finishes

Do you have access to the code? If yes, then just add a call statement at its end:

(defun MyFunction1st()
...
[color=magenta] (MyFunction2nd)   ;add call to second function[/color]
(princ)
)

Other:

(defun MyFunction3rd()
(MyFunction1st)   ;call first function
(MyFunction2nd)   ;call second function
(princ)
)

Or, maybe, take a look to reactors.

 

 

make the lisp quit and call another one.

Can you give us more details on this? You are looking to call the second function instead of first? For this case, if the symbol isn't protected, redefine it:

(defun MyFunction1st()
(MyFunction2nd)   ;call second function
(princ)
)

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