Hi, Everyone.
This is my first post... and it's a question. I want to know if someone already figured this out. I don´t have much experience at programming, in fact, I just know how to add simple variables and commands to existing lisps. In this case I have this file, and I modified it to convert selected blocks to scale 1, 1, 1. but I would like to use it on attribute blocks, because this lisp doesn´t scale the attributes, It will just scale the entities inside the blocks and leave the attributes as they are.
I know it's possible to scale attribute blocks using the "properties dialog box", but I would like to know if someone can make it work in this lisp.
What I want specifically is a routine (or this routine) to read selected objects, filter blocks only, get each of their x scale factor, and scale each block to make that s scale value to become the current dimscale value.
Code:
;;; BXY by David Harrington
;;; Edit block x,y and z values
;;;
;;; Main Program
;;;
(defun c:B1 (/ ss xs ys zs num x na lst editxyz_error olcmdecho old_err)
(defun editxyz_error (msg)
(if (or
(= msg "Function cancelled")
(/= msg "quit / exit abort")
)
(princ (strcat "Error: " msg))
)
(command ".UNDO" "E" "UNDO" "")
(setq *error* old_err
old_err nil
)
(setvar "CMDECHO" olcmdecho)
(princ)
)
(setq old_err *error*
olcmdecho (getvar "CMDECHO")
*error* editxyz_error
)
(setvar "CMDECHO" 0)
(princ "\n EDITXYZ - Edit block x, y and z values")
(command ".UNDO" "BE") (prompt "\nSelect Xrefs or Blocks to rescale: ")
(cond
((setq ss (ssget '((0 . "INSERT"))))
(setq num (sslength ss))
(setq x 0)
(repeat num
(setq na (ssname ss x))
(setq lst (entget na))
(setq lst (subst (cons 41 1) (assoc 41 lst) lst))
(setq lst (subst (cons 42 1) (assoc 42 lst) lst))
(setq lst (subst (cons 43 1) (assoc 43 lst) lst))
(entmod lst)
(entupd na)
(setq x (+ x 1))
)
)
)
(command ".UNDO" "E")
(setq *error* old_err)
(setvar "CMDECHO" olcmdecho)
(princ)
)