hello, I hope you are well, someone was able to correct the problem I had with your Lisp (See below) however I have another problem, when I run the command, nothing happens after the 8th stage. Can you tell me why, please?
the lisp does not ask me to select the blocks
; Make new layout tabs based on block in model spce
; By AlanH July 2023
; French version for Model
(defun c:mktabs ( / ss obj inspt atts layname cpt bl tr ss2)
(setvar 'ctab "MODEL")
(princ "\n1")
(command "_.zoom" "_Extent")
(princ "\n2")
(setq ss (ssget "_X" '((0 . "INSERT")(2 . "E0-Cadre")(410 . "MODEL"))))
(repeat (setq x (sslength ss))
(setq obj (vlax-ename->vla-object (ssname ss (setq x (- x 1)))))
(setq inspt (vlax-get obj 'insertionpoint))
(setq atts (vlax-invoke obj 'Getattributes))
(setq layname (vlax-get (nth 0 atts) 'textstring))
(setq cpt (mapcar '+ inspt (list 212.7405 137.0 0.0)))
(setq bl (mapcar '+ inspt (list 20 30 0.0)))
(setq tr (mapcar '+ inspt (list 395 244 0.0)))
(setq ss2 (ssget "_WP" (list tr bl)))
(if (= ss2 nil)
(princ "SKIP THE BLOCK")
(progn
(command "_.layout" "_c" "Master" layname)
(princ "\n3")
(setvar 'ctab layname)
(command "_.zoom" "_Extent")
(command "_.mspace")(princ "\n4")
(command "_.zoom" "_C" cpt "0.9XP")(princ "\n5")
(command "_.pspace")
(setq ent (ssname (ssget "_X" (list (cons 0 "Viewport")(cons 410 (getvar 'ctab)))) 0))
(setq obj (vlax-ename->vla-object ent))
(princ "\n6")
(vla-put-DisplayLocked obj -1)
(setvar 'ctab "Model")
(princ "\n7")
)
)
(princ "\n8")
)
(princ)
)
(c:mktabs)