Page 1 of 1

Error: application is locked and cannot be unloaded.

Posted: Tue Dec 20, 2022 8:50 am
by SPirou4D
Hi all,
I don't understand why my prompt history give me always this error after some Lisp script execution, please?

I use my IntelliCAD v10.0.1572.123806.PE.VC15.x64.CMS100a in US ui .

And my lisp folder in root C:Lisp/

Re: Error: application is locked and cannot be unloaded.

Posted: Tue Dec 20, 2022 9:18 am
by QuanNguyen
Hi,
Please refer to this, hope this helps you.
Regards.

viewtopic.php?p=7032&hilit=application+ ... 3f21#p7032

Re: Error: application is locked and cannot be unloaded.

Posted: Tue Dec 20, 2022 9:26 am
by SPirou4D
QuanNguyen wrote:
Tue Dec 20, 2022 9:18 am
Please refer to this, hope this helps you.
viewtopic.php?p=7032&hilit=application+ ... 3f21#p7032

Code: Select all

(vl-load-com)
I read it but where can I place this code in this script ? :

Code: Select all

(defun c:areacal (/ area dxf_ent ent js n nb ptlst pt_ins)
	(if (setq js 	
				(ssget '(
							(0 . "LWPOLYLINE")
							(-4 . "<AND")
							(-4 . "&")
							(70 . 1)
							(-4 . ">")
							(90 . 2)
							(-4 . "<")
							(90 . 5)
							(-4 . "AND>")
						)
				)
		)
		(progn
			(repeat (setq nb (sslength js))
				(setq 
					ent     (ssname js (setq nb (1- nb)))
					dxf_ent (entget ent)
					ptlst	(mapcar 'cdr
								(vl-remove-if-not
								'(lambda (x) (= (car x) 10))
								dxf_ent
								)
							)
					n	      (length ptlst)
					pt_ins  (list 	(/ (apply '+ (mapcar 'car ptlst)) n)
									(/ (apply '+ (mapcar 'cadr ptlst)) n)
							)
					area    (vla-get-Area (vlax-ename->vla-Object ent))
				)
				(entmake
					(list
						'(0 . "TEXT")
						(cons 10 pt_ins)
						(cons 40 (getvar "TEXTSIZE"))
						(cons 1 (strcat "Area= " (rtos area)))
						(cons 72 4)
						(cons 11 pt_ins)
					)
				)
			)		
		)	
	)
(princ "End AREA calculation!")
)

Re: Error: application is locked and cannot be unloaded.

Posted: Tue Dec 20, 2022 9:27 am
by SPirou4D
I try it at the end but nothing change, always this error!

EDIT: Haaaaa YES QuanNguyen at the start!
Ok now the result is write in the middle of the selection! Ok.
I didn't know that! Thks a lot

Re: Error: application is locked and cannot be unloaded.

Posted: Tue Dec 20, 2022 9:33 am
by QuanNguyen
It works on IntelliCAD v10.1
Sorry, I don't have the 10.0 version now.

Re: Error: application is locked and cannot be unloaded.

Posted: Wed Dec 21, 2022 3:13 am
by SPirou4D
No problem, I understood... I add it at the start of the code. That"s work great!
Thks a lot dear QuanNguyen!