Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Active Contributor
40 Posts
1 Kudo
Registered: ‎04-02-2009
Post 1 of 2

Need help creating a script to run multiple lisps (if it's even possible)

216 Views, 1 Replies
04-17-2012 12:45 PM

I have hundreds of drawings I want to run through scriptpro with a script calling 3 different lisp routines.  I have the 3 lisps working independantly but can't figure out how to get them to all run in one script.  Is this even possible?

 

Two of the Lisps are for redefining the title block in 2 different types of drawings that have different title blocks.  The last lisp locks all viewports in all windows.  I'll attach the 3 lisps I'm trying to merge in the script.  I am not very versed in scripts and lisps so I'm guessing at least 2 of these lisps could be merged into a single lisp...I just don't know how.  Thanks for any help.

 

Here is what I have for the script file contents (which doesn't work):

 

(load "redefine100")

 

(load "redefine102")

 

(load "vlocker")

 

qsave

*Expert Elite*
2,535 Posts
306 Kudos
Registered: ‎11-24-2009
Post 2 of 2

Re: Need help creating a script to run multiple lisps (if it's even possible)

04-17-2012 10:58 PM in reply to: david.augspurger

david.augspurger wrote:

I have hundreds of drawings I want to run through scriptpro with a script calling 3 different lisp routines.  I have the 3 lisps working independantly but can't figure out how to get them to all run in one script.  Is this even possible?

 

Two of the Lisps are for redefining the title block in 2 different types of drawings that have different title blocks.  The last lisp locks all viewports in all windows.  I'll attach the 3 lisps I'm trying to merge in the script.  I am not very versed in scripts and lisps so I'm guessing at least 2 of these lisps could be merged into a single lisp...I just don't know how.  Thanks for any help.

 

Here is what I have for the script file contents (which doesn't work):

 

 


(command "_.insert" "icn-bs4=icn-bs4")
(command); cancels the insert command but cancels the script too

 

Exactly, The way your routine is written not only it will cancel the "insert" command, it will cancel the script  as well

 

Try this instead

 

(defun BLKREDEF ( blkname / bn blkname cmde)
(vl-load-com)      
(setq adoc (vla-get-activedocument (vlax-get-acad-object)))      
 (if (and (tblsearch "block" (vl-filename-base blkname))
         (setq bn (findfile blkname)))
  (progn
        (vlax-invoke  (vlax-get
                            (vla-get-ActiveLayout adoc)
                                              'Block)
                                        'InsertBlock
                                        '(0.0 0.0 0.0)
                                        bn 
                                        1 1 1 0)
        (entdel (entlast))
        (vla-regen aDoc acActiveViewport)
 (princ (strcat "\nBlock " (strcase (vl-filename-base blkname)) " redefined."))
  )
  (princ "Block not found.")
 )
 (prin1)
)

 

 (BlkRedef "D:\\ThisFolder\\Blocks\\TEST.dwg")

 

And continue with your Viewport lock routine

 

 

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post