Community
Dynamic Blocks Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Attribute quick move

0 REPLIES 0
Reply
Message 1 of 1
BB8x
100 Views, 0 Replies

Attribute quick move

Hello. 

 

I have lisp to quick move regular texts. Would be possible to have same lisp, but to move dynamic block attributes in same way? Without choosing block, grabbing node and move?

 

Code for text quick move:

;; Mods by BeekeeCZ to honor the OSNAPZ setting
;; Added QuickMode2d to force OSNAPZ 1

;; QuickMOVE originaly written by CAB
;;  Version 1.2  -  02.11.2010
;;  No UCS support
;;  If set to Loop, Press ENTER or ESCape to exit.
;;  Use DXF 10 if it exist except for Hatch
;;  Else use Pick Point of LL of bounding box if flag is set
;;
;;  Note that the DXF code 10 my not be desirable on some objects
;;
;(defun c:p () (c:Quickmove))
(defun c:Quickmove (/ ent elst BasePt minpt maxpt Loop pkPoint NoDXF10)
  (setq loop t) ; set to nil to make routine not Loop
  (setq pkPoint nil) ; t = use pickpoint if no dxf 10
  ;; nil = use lower left of bounding box if no dxf 10
  (setq NoDXF10 '("HATCH" "LWPOLYLINE")) ; list to exclude use of DXF 10
  (command "._undo" "_begin")
  (while
    (and
      (setq ent (entsel "\nSelect object to move: "))
      (progn
	(setq BasePt (cadr ent)) ; default move point
	(setq elst (entget (car ent)))
	(if (and (assoc 10 elst)
		 (not (member (cdr(assoc 0 elst)) NoDXF10)))
	  (setq BasePt (cdr (assoc 10 elst)))
	  (if (not pkPoint)
	    (progn
	      (vla-getboundingbox (vlax-ename->vla-object (car ent)) 'minpt 'maxpt)
	      (and (setq minpt (vlax-safearray->list minpt))
		   (setq BasePt minpt)))))
	(command "._undo" "_mark")
	(if (= (getvar 'osnapz) 1) ; added by BeekeeCZ to honor OSNAPZ setting.
	  (setq BasePt (reverse (cdr (reverse BasePt)))))
	(command "._move" (car ent) "" "_non" BasePt pause)
	;;  Test for ENTER pressed ILO point picked
	(if (equal 0.0 (distance BasePt (getvar "lastpoint")) 0.0001)
	  (command "._undo" "_back") ; & exit
	  t))
      Loop))
  (princ)
  )

(defun c:p ( / *error* z)  ;; added by BeekeeCZ to force OSNAPZ to 1
  (defun *error* (errmsg)
    (if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break,end"))
      (princ (strcat "\nError: " errmsg)))
    (if z (setvar 'osnapz z))
    (princ))
  (setq z (getvar 'osnapz)) (setvar 'osnapz 1)
  (c:Quickmove)
  (*error* "end"))
 (setvar "osnapz" 0)

 

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Customer Advisory Groups


”Boost