Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Mentor
aqdam1978
Posts: 265
Registered: ‎11-05-2008
Message 1 of 5 (355 Views)

How to execute and exit VLISP in lisp code?

355 Views, 4 Replies
02-15-2013 09:13 AM

Hi,

 

I need to run VLISP / (_VLIDE) in my lisp code.

how can I run _VLIDE inside of my lisp code and also how can close VLISP by lisp code?

 

 

 

[VLISP=_VLIDE=Visual Lisp Editor]

 

Thanks,

 

Contributor
mkweaver
Posts: 16
Registered: ‎12-05-2007
Message 2 of 5 (313 Views)

Re: How to execute and exit VLISP in lisp code?

02-18-2013 06:58 PM in reply to: aqdam1978

(C:vlide) will start the editor but I don't know of any way to close the editor using lisp.

 

 

Mike Weaver

Active Contributor
ales.stanek
Posts: 31
Registered: ‎05-14-2009
Message 3 of 5 (271 Views)

Re: How to execute and exit VLISP in lisp code?

02-20-2013 04:01 AM in reply to: aqdam1978

Hi,

if you want to run vlide in code and it isn't last operation. Use syntax (C:vlide T). The command start vlide and get back control to original program. I use it for automatic build fas files.

 

 

 

Ales Stanek

Mentor
aqdam1978
Posts: 265
Registered: ‎11-05-2008
Message 4 of 5 (256 Views)

Re: How to execute and exit VLISP in lisp code?

02-20-2013 07:15 PM in reply to: ales.stanek

YES, exactly I want to uses in my code that I prepare to BATCH FAS MAKER!!!

my code is:

 

(defun c:FAS_Maker (/ path files itm des)
	(defun ReplaceStr (NewStr Patt Str / pos)
		(setq pos 0)
		(While (setq pos (vl-string-search patt str pos))
			(setq Str (vl-string-subst NewStr patt Str pos))
			(setq pos (+ pos (strlen NewStr)))
		)
	str
	)
	(setq path "C:\\LISP\\")
	(setq files (vl-directory-files path "*.LSP" 1))
	(if (> (length files) 0)
		(progn
			(setq des (open (strcat path "t.scr") "w" ))
			 (foreach itm files
				(write-line (strcat "(vlisp-compile 'st \"" (ReplaceStr "\\\\" "\\" path) itm "\")") des)   
			 );;foreach
			(write-line "(alert \"All files compiled...\")" des)
			(close des)
			(C:VLIDE T)
			(command "script" (strcat path "t.scr"))
			;;(close "VLIDE");;
			(princ)
		);;progn
		(alert "Error!:\n\nThere is no any \"*.LSP\" files in \"C:\\LISP\\\" folder!\n\nPlease copy your *.LSP files to this folder and try again!")	
	);;if
);;defun

 Just copy your LSP files to C:\LISP\ folder and run the code!

 

BUT!, I can't close VLISP via lisp code!

 

does anybody knows that how can I close VLIDE?!

 

Thanks,

 

Abbas

 

Active Contributor
ales.stanek
Posts: 31
Registered: ‎05-14-2009
Message 5 of 5 (248 Views)

Re: How to execute and exit VLISP in lisp code?

02-21-2013 01:39 AM in reply to: aqdam1978

hi,

 

I use a litle diferent approach.

 

I create bat file that run autocad with scr file. (The bat file I start manualy but is possible make this as "night build" by windows scheduler or run this bat file by innosetup for example.)

 

scr file load and run lisp file.

 

by vl-catch-all-apply i manage proces of creating fas files for each lsp file

 

and at the end i quit AutoCAD

 

 

Ales Stanek

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.