12/11/2022 0 Comments Autocad lisp assoc 8(if (eq "ARC" (cdr (assoc 0 (entget (car x))))) (cond ((eq (getvar 'ERRNO) 7) (princ "\nMissed, try again.")) Try adding the following to the bottom of your code: (defun AT:GetSel (meth msg fnc / ent) ((eq 7 (getvar 'errno)) (setq good (prompt "\nMissed, try again."))) ((setq good (eq 52 (getvar 'errno))) nil) (setq good (cond ((or (not fnc) (fnc ent)) ent) Ex: (AT:GetSel entsel "\nSelect arc: " (lambda (x) (eq (cdr (assoc 0 (entget (car x)))) "ARC"))) fnc - optional function to apply to selected object msg - message to display (nil for default) meth - selection method (entsel, nentsel, nentselp) (defun AT:GetSel (meth msg fnc / ent good) '(Insertionpoint Rotation XEffectiveScaleFactor YEffectiveScaleFactor (vlax-for x (setq ss (vla-get-activeselectionset *AcadDoc*)) ((setq *AcadDoc* (vla-get-activedocument (vlax-get-acad-object)))) (princ "\nSelect blocks to be repalced: ") (setq blk (vlax-ename->vla-object (car x))) (/= 4 (logand (cdr (assoc 70 (entget (tblobjname "LAYER" (cdr (assoc 8 e)))))) 4)) (eq "INSERT" (cdr (assoc 0 (setq e (entget (car x)))))) (if (and msg (not (wcmatch (strcase msg) "*BREAK*,*CANCEL*,*QUIT*,"))) (and f *AcadDoc* (vla-endundomark *AcadDoc*)) Size and Rotation will be taken from original block and original will be deleted Replace multiple instances of selected blocks (can be different) with selected block
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |