Message 1 of 5

Not applicable
09-09-2020
08:13 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I am learning slowly at the same time, but I have a problem when I come up with a variable named "$ folblock" (an old command according to my research).
How to avoid the error please?
If i delete---> " (cons '2 $FOLBLOCK) " the code will works ,but I'm not sure, because I don't understand the usefulness of (cons '2 $FOLBLOCK)
(defun NUMFOL (/ FS LF FT FM E E1 NF)
(check_init)
(LIDERFOL 0)
(if (/= LF 0)
(progn
(princ "\nMise à jour de la numérotation des folios ... patientez\n")
(setq FS (1+ (atoi (cdr (assoc 2 (tblnext "LAYER" T))))))
(while (and (<= FS LF)(tblnext "LAYER"))
(while (and (<= FS LF)(= (tblsearch "LAYER" (itoa FS)) nil))
(setq FS (1+ FS))
)
(setq FT (itoa FS))
(if (= (strlen FT) 1)(setq FM (strcat "0" FT))(setq FM FT))
(princ (strcat "\rTraitement du folio " FM "/" (itoa LF)))
(setq E (ssget "X" (list (cons '8 FT) (cons '2 $FOLBLOCK))))
(if E
(progn
(setq E (cdr (assoc -1 (entget (ssname E 0))))
E1 (entnext E)
)
(while (= "ATTRIB" (cdr (assoc 0 (entget E1))))
(setq E1 (entget E1))
(cond ((= (cdr (assoc 2 E1)) "NF")
(setq NF (cdr (assoc 1 E1)))
(setq E1 (subst (cons 1 FM) (assoc 1 E1) E1))
(entmod E1)
(entupd (cdr (assoc -1 E1)))
);end ATT=NF
);end cond
(setq E1 (entnext (cdr (assoc -1 E1))))
);end while
);end progn
(princ (strcat "\nFolio " FM " sans bloc "$FOLBLOCK", ignoré...\n"))
);end if E
(setq FS (1+ FS))
);end while
(princ "\nTerminé")
);end progn
(princ "\nAucun folio n'a été créé ! Utilisez NOUVFOL")
);end if
(princ)
);end defun
Thans a lot !! 🙂
Solved! Go to Solution.