Hello,
I would like to change the CenterX, CenterY, Length, and Height of a viewport, but it will not let me use "entmod" to update the object. I wrote the code only to find out later that "entmod" doesn't work on viewports.
My LiSP routine will change the listed variables, but I cannot get it to actually update the viewport. If anyone has a way to do this, could you please let me know how?
Thanks,
Mark
Below is my code so far
(defun C:mvw ()
;Get the viewport on tab P9, then get the center, length and height
(setq vport_entity (entget (ssname (ssget "X" '((0 . "VIEWPORT")(410 . "P9"))) 0)))
(setq vport_loc_X (car (cdr (assoc 10 vport_entity))))
(setq vport_loc_Y (cadr (cdr (assoc 10 vport_entity))))
(setq vport_loc_Z (caddr (cdr (assoc 10 vport_entity))))
(setq vport_length (cdr (assoc 40 vport_entity)))
;Create the new values
(setq new_vport_X (- vport_loc_X 50.0))
(setq new_vport_loc (list new_vport_X vport_loc_Y vport_loc_Z))
(setq new_vport_length (- vport_length 50.0))
(setq vport_entity (subst (cons 10 new_vport_loc) (assoc 10 vport_entity) vport_entity))
(setq vport_entity (subst (cons 40 new_vport_length) (assoc 40 vport_entity) vport_entity))
(entmod vport_entity)
)
Thanks in advance,
Mark