
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All,
I want to create a routine with the require as below:
Choose the area, it will select only circles with layername is :55.
Next step:
If that circle with diameter Ø3.3-->Out put will be M4(Using Mtext) -->Change Ø3.3 and M4(Mtext)to layername(22)
If that circle with diameter Ø4.2-->Out put will be M5(Using Mtext) -->Change Ø4.2 and M5(Mtext)to layername(33)
If that circle with diameter Ø5-->Out put will be M6(Using Mtext) -->Change Ø5 and M6(Mtext)to layername(44)
If the quantity of Ø3.3 is 1-->output-->1-M4, 2-->output-->2-M4.......Ø4.2&Ø5 is the same.
I am trying to create a lisp but get stucked.........The sample file is also attached.It will be greated if it is done perpectly by someone can help me!
------------------------------------
(defun C:TAP ()
(if(setq A (ssget "_:L" '((-4 . "<and") (0 . "CIRCLE") (8 . "55") (-4 . "and>"))))
(progn
(setq n 0)
(setq B (sslength A))
(while (< n B)
(setq C (ssname A n))
(setq D (entget C))
(setq B2 (cdr (assoc 40 D)))
(setq B1 (* B2 2))
(setq n (+ n 1))
(command
"_.MTEXT"
pause
"_Justify" "TL"
"_Height" 20
"_none" "@"
B "M" B1 ""))))
(princ)
)
Solved! Go to Solution.