transcad Posted June 1, 2012 Posted June 1, 2012 I want to move one object, and i use this: (command "_.move" (nth i lst) "" p1 p2) (nth i lst) is () What's wrong? How should be? Quote
Tharwat Posted June 1, 2012 Posted June 1, 2012 post the list of your variable lst to check them out for sure Quote
pBe Posted June 1, 2012 Posted June 1, 2012 AFAICT the syntax is correct: (command "_.move" (nth i lst) ; "" p1 p2) now if from a selection set it would be (ssname i lst) Quote
transcad Posted June 1, 2012 Author Posted June 1, 2012 Here is the whole lisp, command move do nothing... should work for pairs of point and text , where insertion point has the same x and y coordinates, z is different (defun c:pz (/ layer punct) (princ "\nSELECTEAZA PUNCTELE") (setq ssp (ssget '((0 . "point")))) (princ "\nSELECTEAZA TEXTELE") (setq sst (ssget '((0 . "text")))) ;;;;;;;;;;;;;;;;;;;;;;LISTA PUNCTE (setq i 0) (setq listap nil) (repeat (sslength ssp) (setq ename (ssname ssp i)) (setq data (entget ename)) (setq entName (cdr (assoc -1 data))) (setq punct (cdr (assoc 10 data))) (setq layer (cdr (assoc 8 data))) (setq culoare (cdr (assoc 62 data))) (setq listap (cons (list punct layer culoare entName) listap)) (setq i (1+ i)) ) ;;;;;;;;;;;;;;;;;;;;;;LISTA TEXTE (setq i 0) (setq listat nil) (repeat (sslength sst) (setq ename (ssname sst i)) (setq data (entget ename)) (setq entName (cdr (assoc -1 data))) (setq pct (cdr (assoc 10 data))) (setq z (atof (cdr (assoc 1 data)))) (setq ztext (caddr pct)) (setq listat (cons (list pct z ztext) listat)) (setq i (1+ i)) ) ;;;;;;;;;;;;;;;;;;;;; ; (setq listabuna nil) (setq listaent nil) (setq i 0) (repeat (length listap) (setq text (nth i listat)) (foreach punct listap (if (= (car (car text)) (car (car punct))) (setq p (list (list (car(car punct)) (cadr(car punct)) (cadr text) ) ;_ end of list (setq la (cadr punct)) (setq cul (caddr punct)) (setq entitate (cadddr punct)) ) ) ;_ end of setq ) ;_ end of if ) ;_ end of foreach (setq listabuna (cons p listabuna)) (setq listaent (cons entitate listaent)) (setq i (1+ i)) ) ;_ end of repeat (setq i 0) (repeat (length listabuna) (entmake (list (cons 0 "POINT") (cons 8 (cadr (nth i listabuna))) (if (/= (caddr (nth i listabuna)) nil) (cons 62 (caddr (nth i listabuna))) (cons 62 256) ) (cons 10 (car(nth i listabuna))))) (command "_.move" (nth i listaent) "" (setq pti(car (nth i listat))) (setq ptf (list (car (car (nth i listat))) (cadr (car (nth i listat))) (cadr (nth i listat))))) (setq i (1+ i)) ) (setq sse (ssadd)) (foreach ent listaent (ssadd ent sse)) (command "erase" sse "") (princ) ) Quote
MSasu Posted June 1, 2012 Posted June 1, 2012 You need to focus to debug the listabuna variable; it is not so good as should be*. Also, pay attention that DXF code 62 isn't available if color is set as ByLayer. (buna = the good one) Quote
pBe Posted June 1, 2012 Posted June 1, 2012 Also, pay attention that DXF code 62 isn't available if color is set as ByLayer. True MSasu, were you able to wirte the code for BDAY greeting? Quote
MSasu Posted June 1, 2012 Posted June 1, 2012 MSasu, were you able to wirte the code for BDAY greeting? I'm afraid that not, yet! Quote
pBe Posted June 1, 2012 Posted June 1, 2012 I'm afraid that not, yet! No big deal Mircea, just bringing a little bit fun for us all. Cheers Quote
Recommended Posts
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.