19 July 2013

How to move the dimension text with leader in AutoCAD || aidimtextmove command in AutoLISP

Hi friends, in this article I will explain about how to change dimension text  to move with leader in AutoCAD or aidimtextmove command in AutoLISP or How to move the dimension text with leader in AutoCAD.

First we know about, how dimension text to move with ladder in AutoCAD changed in AutoCAD .
Open the AutoCAD, Select Dimension text, right click on the Dimension text, and select Dim text position and Move with leader and click where to you want. The output will like below.

Lets we write the code for it in AutoLISP.I explain this with small example.


First Open theAutoLISP Editor write the below code or copy and paste the code and save it as ddd.LSP.

(defun c:ddd()
  (setq p1(getpoint "\n first point")
               p2(getpoint "\n second point")
               )
  (command "rectang" p1 p2 "")
  (command "dim" "vertical" p1 p2 (strcat "@" (rtos 5) "<180") "")(setq n (entlast))
  (command "exit")
  (setq p3(getpoint "\n point where you want to get leader ")
               )
  (command "aidimtextmove" 1 n "" p3  "")
  )

Open AutoCAD and enter the below commands

Command: (load "dd")
C:DDD
Command: ddd
 First point
 Second point
 Point where you want to get leader Unknown command "DDD".

The output will shown in the below figure.

Thank you for reading my blog AutoLISP-Kishore..If you like my blog please like the facebook page AutoLISP-Kishore.

No comments:

Post a Comment