Jump to content

can somebody help me with: non-negative: -1


plecs

Recommended Posts

I want to make a new application and when I press the load button lsp file I give the error "error: bad argument value: non-negative: -1"

Link to comment
Share on other sites

(defun c:intdrstg ()
;==========================================================================================================================
(vl-load-com)
;==========================================================================================================================
(resetsilviu) ;se afla in setari_MobCAD
;==========================================================================================================================	
(setq ipt (getpoint "\n Alege colt DR-JOS <Exit>: "))
(setq ipt1 (getpoint "\n Alege colt DR-SUS <Exit>: "))
(setq ipt2 (getpoint "\n Pina unde STG-SUS <Exit>: "))
;==========================================================================================================================
(defun caremaidecare ()
;==========================================================================================================================
(vl-load-com)
;==========================================================================================================================
(mapcar (function (lambda ( sym foo str def )
       (set sym (cond (((eval foo) (strcat str " <" (vl-princ-to-string 
	(set sym (cond ((eval sym)) ( def )))) "> : " ))) ((eval sym))))))
   '(*nrs* *ret*) '(getint getint)
   '("\nNumar Spatii" "\nRetragere Intermediar DIN FATA") '(3 100))
;==========================================================================================================================
(progn
	(setq nrint (- *nrs* 1))													;numar intermediari
	(setq spatiu (/(- (- (car ipt) (car ipt2)) (* nrint grPAL)) *nrs*))			;lungime sparii intre intermediari
	(setq disp (rtos spatiu 5))
	(setq hint (- (caddr ipt1) (caddr ipt)))									;inaltime intermediari H
	);end progn
	(princ)
);end defun
(princ)
;==========================================================================================================================
(setq myAnswer "Da")                          ; set up a variable to hold the answer
(setq dnint nil)                          ; set up a variable to hold your guess
(while (/= myAnswer dnint)                ;while you don't know the answer 
			(initget  "Da Nu")
			(setq dnint (getkword (strcat "\nSpatiu = "  disp "mm" "[Da/Nu]: ")))
			(caremaidecare)
			)                                             ;close the loop
;==========================================================================================================================
(cond ((= ckret "0")
	(progn
		(setq *a* (- *a* (+ *ret* *retpfl*)))										;adincime intermediari
		(setq ckret "1")			;ckret - este variabila care scade pfl daca are falt sau nut
		);end progn
		)
	((= ckret "1")
	(progn
		(setq *a*  *a*)						;adincime polita cu retragere daca este cazul
		);end progn
		)
	(T (prompt "\nInter Gresit"))
	);end cond	
;==========================================================================================================================	
(offresetvar) ;se afla in setari_MobCAD
;==========================================================================================================================	
(resetsilviu) ;se afla in setari_MobCAD
;==========================================================================================================================
(if (= dnint "Da")
(progn			
(repeat nrint
(if (null ipti)
	(progn
		(setq ipti (list (- (car ipt) (+ spatiu grPAL)) (+ (cadr ipt) *ret*) (caddr ipt)))		;XYZ point intermediari
		(command "_.box" "_non" ipti "L" grPAL *a* hint)(int1000)
		(setq a1 (list (car ipt) (cadr ipti)(caddr ipt)))	;XYZ point dreapta jos
		(setq a2 (list (car ipt) (cadr ipti)(caddr ipt1)))	;XYZ point dreapta sus
		(setq a3 (list (car ipt2) (cadr ipti)(caddr ipt))) 	;XYZ point stinga jos
		(setq a4 (list (car ipt2) (cadr ipti)(caddr ipt1))) ;XYZ point stinga sus
		(entmakex (list (cons 0 "POINT") (cons 10 a1)))
		(entmakex (list (cons 0 "POINT") (cons 10 a2)))
		(entmakex (list (cons 0 "POINT") (cons 10 a3)))
		(entmakex (list (cons 0 "POINT") (cons 10 a4)))
		(setq s4 (list (car ipt) (cadr ipti) (caddr ipt1)))
		(setq s1 (list (- (car ipt) spatiu)(cadr ipti) (caddr ipt1)))	;XYZ point semn inter dreapta
		(setq s2 (list (car ipti) (cadr ipti) (caddr ipt1)))			;XYZ point semn inter stinga
		(setq s3 (list (car ipt2) (cadr ipti) (caddr ipt1)))			;XYZ point semn stinga
		(setq tx1 (list (+(car s1) (-(/ spatiu 2)150)) (cadr ipti) (caddr ipt1))) ;XYZ point text dreapta
		(setq tx2 (list (+ (car s3)(-(/ spatiu 2)150)) (cadr ipti) (caddr ipt1))) ;XYZ point text stinga	
		(command "-insert" "dimsk" s4 "1" "" "0")(command "explode" (entlast));semn interior corp dreapta
		(command "-insert" "txto" tx1 "1" "" "0")(command "explode" (entlast));
		(command "-insert" "dimsj" s1 "1" "" "0")(command "explode" (entlast));semn inter dreapta
		(command "-insert" "dimsk" s2 "1" "" "0")(command "explode" (entlast));semn inter stinga
		(command "-insert" "txto" tx2 "1" "" "0")(command "explode" (entlast));
		(command "-insert" "dimsj" s3 "1" "" "0")(command "explode" (entlast));semn interior corp stinga
		(setq newcot (rtos spatiu 5))
		(modcota)
		(setq cv1 (list (- (car ipti)160) (cadr ipti) (+ (caddr ipti) (-(/ hint 2)150)))) ;XYZ point text vertical
		(setq cv2 (list (car ipti) (cadr ipti)(+ (caddr ipti) hint)));XYZ point semn sus
		(command "-insert" "dimss" ipti "1" "" "0")(command "explode" (entlast));semn jos
		(command "-insert" "txtv" cv1 "1" "" "0")(command "explode" (entlast));text	
		(command "-insert" "dimjs" cv2 "1" "" "0")(command "explode" (entlast));semn sus
		(setq newcot (rtos hint 5))
		(modcota)
		)
	(progn
		(setq ipti (list (- (car ipti) (+ grPAL spatiu)) (cadr ipti) (caddr ipti)))		;XYZ point intermediari
		(command "_.box" "_non" ipti "L" grPAL *a* hint)(int1000)
		(setq s1 (list (car ipti) (cadr ipti) (caddr ipt1)));XYZ point dreapta sus semn
		(setq tx1 (list (+ (car s1) (-(/ spatiu 2)130))(cadr s1) (caddr s1))) ;XYZ point text
		(setq s2 (list (+(car s1) grPAL)  (cadr s1) (caddr s1))) ;XYZ point stinga sus semn
		(command "-insert" "dimsk" s1 "1" "" "0")(command "explode" (entlast));semn stinga
		(command "-insert" "txto" tx1 "1" "" "0")(command "explode" (entlast));text	
		(command "-insert" "dimsj" s2 "1" "" "0")(command "explode" (entlast));semn dreapta
		(setq newcot (rtos spatiu 5))
		(modcota)
		)
		);end if
		);end repeat
;==========================================================================================================================
(setq htext (RTOS hint))
(setq htext1 (RTOS spatiu))
(setq text (STRCAT "\nH-Inaltime Spatiu = " htext "-mm" "	" "\nLumgime Spatiu = " htext1 "-mm"))
;(setq text1 (STRCAT "\nLumgime Spatiu = " htext1 "-mm" ))
(prompt text)
;==========================================================================================================================
)T);end if
;==========================================================================================================================
(onresetvar);se afla in setari_MobCAD
;==========================================================================================================================
(layrestordef) ;restore active layer ;se afla in setari_MobCAD
;==========================================================================================================================
(setq varlst '(ipt1 ipt2  htext text htext1 text1 ipti a1 a2 a3 a4 s1 s2 tx1 tx2 *adi* *ret* hint spatiu nrint cv1 cv2 newcot
dnint disp))
(mapcar '(lambda (x)(set x nil)) varlst)
;==========================================================================================================================
(princ)
);end defun
(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...