Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

I have a lisp to facilitate moving object text (tag,elevatin,etc.)

9 REPLIES 9
Reply
Message 1 of 10
SKHobbs
654 Views, 9 Replies

I have a lisp to facilitate moving object text (tag,elevatin,etc.)

I wrote this lisp and it has been very handy. input how much offset you want tags to move (i.e. 10,-15) and it moves them for you as you select them. I have been trying to make it take a selection set instead of moving one text at a time. Any ideas?

 

(defun c:MMT (/ a COUNT)
	(setq count 0)
      (setq a (getpoint "\n X,Y OFFSET OR ENTER FOR MANUAL MODE"))
      (terpri)
      (princ "\n SELECT TEXT    ESC TO EXIT")
      (if (= nil a)
    
        (progn(while (< count 10)
		(COMMAND "MOVETEXT" pause pause)))
     
	(progn(while (< count 10)
	(COMMAND "MOVETEXT" pause  (strcat "@" (rtos (car a)) "," (rtos (cadr a)))))))


        

  (princ))

 

9 REPLIES 9
Message 2 of 10
Kent1Cooper
in reply to: SKHobbs

Since you need to make a selection and give it a displacement anyway, couldn't you just do it in an ordinary Move command?  It's not clear to me what enhancement a routine would give you compared to that.

Kent Cooper, AIA
Message 3 of 10
SKHobbs
in reply to: Kent1Cooper

If I use the move command it will move the object, where I need to move just the tag/text.

Message 4 of 10
SKHobbs
in reply to: SKHobbs

I probably should have said this is for pipe and hanger tags, elevations. sorry

Message 5 of 10
jwaldronEMNF9
in reply to: SKHobbs

I have been looking for this for along time. has anyone solved it?

Message 6 of 10
calderg1000
in reply to: jwaldronEMNF9

Regards @jwaldronEMNF9 

Try this code, moves the selected texts, on the Z axis the elevation value entered

(defun c:mtt (/ s elev i sn textv ptext)
  (princ "Select Texts...")
  (setq s    (ssget '((0 . "*text")))
        elev (getreal "\nEnter Elevation Value to Move: ")
  )
  (repeat (setq i (sslength s))
    (setq sn    (ssname s (setq i (1- i)))
          textv (vlax-ename->vla-object sn)
          ptext (vlax-get textv 'insertionpoint)
    )
    (vla-put-insertionpoint textv
                            (vlax-3d-point (mapcar '+ ptext (list 0. 0. elev)))
    )
  )
)

 


Carlos Calderon G
EESignature
>Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

Message 7 of 10
jwaldronEMNF9
in reply to: SKHobbs

This is why I need this. If it could place tags offset. hopefully every tag would not need to be moved, only half of them. 

Message 8 of 10
ВeekeeCZ
in reply to: jwaldronEMNF9

Are you talking about regular blocks with attributes or about verticals eg. C3D or MAP as this thread is probably about.

Message 9 of 10
jwaldronEMNF9
in reply to: ВeekeeCZ

I am talking about the auto generated item tags for spool parts or the numbers for hangers. 
they are generated on top of the hanger in plan view. Then they all need to be manually moved.

 

Message 10 of 10
ВeekeeCZ
in reply to: SKHobbs

Would you post a sample dwg file to take look?

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

Post to forums  

Autodesk Design & Make Report

”Boost