AutoCAD顧問
還沒有註冊嗎...即日起免費註冊,所有最完整的AutoCAD討論、教學及資源都在論壇裡喔~

Join the forum, it's quick and easy

AutoCAD顧問
還沒有註冊嗎...即日起免費註冊,所有最完整的AutoCAD討論、教學及資源都在論壇裡喔~
AutoCAD顧問
Would you like to react to this message? Create an account in a few clicks or log in to continue.
[討論]選取字串A及字串B,輸入文字間距程式 Aoe1-113[討論]選取字串A及字串B,輸入文字間距程式 Ioaoe110[討論]選取字串A及字串B,輸入文字間距程式 2020-310[討論]選取字串A及字串B,輸入文字間距程式 Oiu15010[討論]選取字串A及字串B,輸入文字間距程式 2020-211[討論]選取字串A及字串B,輸入文字間距程式 Ia15010[討論]選取字串A及字串B,輸入文字間距程式 Aizyao10[討論]選取字串A及字串B,輸入文字間距程式 Uos15010[討論]選取字串A及字串B,輸入文字間距程式 BPl3tjj[討論]選取字串A及字串B,輸入文字間距程式 Ziao1510
[討論]選取字串A及字串B,輸入文字間距程式 Aoe15010[討論]選取字串A及字串B,輸入文字間距程式 Oo-2-110[討論]選取字串A及字串B,輸入文字間距程式 Zuoiy_10[討論]選取字串A及字串B,輸入文字間距程式 Aizyao11[討論]選取字串A及字串B,輸入文字間距程式 Iyb_1510[討論]選取字串A及字串B,輸入文字間距程式 Aoe1-112[討論]選取字串A及字串B,輸入文字間距程式 Uos15011[討論]選取字串A及字串B,輸入文字間距程式 Aoe2da10[討論]選取字串A及字串B,輸入文字間距程式 Aoe2da11[討論]選取字串A及字串B,輸入文字間距程式 Aoe10

[討論]選取字串A及字串B,輸入文字間距程式

2 posters

向下

[討論]選取字串A及字串B,輸入文字間距程式 Empty [討論]選取字串A及字串B,輸入文字間距程式

發表 由 老水牛 周四 18 1月 - 15:02

Joseph 寫到:選取字串A及字串B,輸入文字間距,程式自動幫你排間距。
傳送門 >> 分享lsp-文字排間距

由"Joseph"所發表的文字間距。發現 只有文字對正方式在左時,才能作動。其他對正方式則無法作動,請問有其他解決方法,讓其他對正方式也能作動
avatar
老水牛
初級會員
初級會員

文章總數 : 107
年齡 : 62
來自 : 台北縣
職業 : 電機
愛好 : 閱讀
個性 : 溫和
使用年資 : 6
使用版本 : 2006
積分 : 1
經驗值 : 6010
威望值 : 0
注冊日期 : 2008-10-17
男 天蝎座 牛

回頂端 向下

[討論]選取字串A及字串B,輸入文字間距程式 Empty 回復: [討論]選取字串A及字串B,輸入文字間距程式

發表 由 Atsai 周五 19 1月 - 20:27

Joseph分享的程式是更新文字基準點,應該跟對齊方式沒有差別。

以前寫的的對齊程式,以群碼10來作對齊基準,沒有限制物件種類,用看看吧!

代碼:

(defun c:dhx (/ ss pt dy ent_lst endata en-pt)
  (setq os (getvar "osmode"))
  (setvar "cmdecho" 0)
  (setq ss nil)
  (setq pt nil)
  (setq dy nil)
  (setq ss (ssget))
  (setq pt (getpoint "\n選擇對齊基準點:"))
  (setq dy (getreal "\nY向間距:<未輸入則Y座標不變>"))
 
  (setq ent_lst nil)
  (setq i 0)
  (repeat (sslength ss)
    (setq ent_lst (append ent_lst (list (ssname ss i))))
    (setq i (1+ i))
  )

  ;按Y座標排序start Y:大->小
  (setq   ent_lst   (vl-sort ent_lst
          '(lambda (e1 e2)
             (> (caddr (assoc 10 (entget e1)))
               (caddr (assoc 10 (entget e2)))
             )
           )
      )
  ) ;按Y座標排序end

  (if (/= dy nil)
    (progn
      (setq endata nil)
      (setq en-pt nil)
      (setq i 0)
      (foreach n ent_lst
   (setq endata (entget n))
   (setq en-pt (cdr (assoc 10 endata)))
   (setq endata (subst (cons 10 (list (car pt) (+ (cadr pt) (* i -1 dy)) (caddr en-pt)))
             (assoc 10 endata)
             endata
          )
   )
   (entmod endata)
   (setq i (1+ i))
      )
    )
    (progn
      (setq endata nil)
      (setq en-pt nil)
      (foreach n ent_lst
   (setq endata (entget n))
   (setq en-pt (cdr (assoc 10 endata)))
   (setq endata (subst (cons 10 (list (car pt) (cadr en-pt) (caddr en-pt)))
             (assoc 10 endata)
             endata
          )
   )
   (entmod endata)
      )
    )
  )
 
  (setvar "osmode" os)
  (princ)
)

____________________________________________________________________________________
[討論]選取字串A及字串B,輸入文字間距程式 Ioaoe110 [討論]選取字串A及字串B,輸入文字間距程式 Zuoiy_10 [討論]選取字串A及字串B,輸入文字間距程式 2020-211 [討論]選取字串A及字串B,輸入文字間距程式 Aizyao11 [討論]選取字串A及字串B,輸入文字間距程式 Iyb_1510
[討論]選取字串A及字串B,輸入文字間距程式 Aizyao10 [討論]選取字串A及字串B,輸入文字間距程式 BPl3tjj.png [討論]選取字串A及字串B,輸入文字間距程式 Ziao1510 [討論]選取字串A及字串B,輸入文字間距程式 Oo-2-110 [討論]選取字串A及字串B,輸入文字間距程式 Oooa_110
Atsai
Atsai
中級會員
中級會員

文章總數 : 164
年齡 : 49
來自 : 台中
職業 : 工程
愛好 : 看漫畫
個性 : 樂天
使用年資 : 10
使用版本 : 2010
AutoCAD基礎篇等級 : 10星級
積分 : 8
經驗值 : 5793
威望值 : 518
注冊日期 : 2012-04-06
男 金牛座 兔

回頂端 向下

回頂端


 
這個論壇的權限:
無法 在這個版面回復文章
[討論]選取字串A及字串B,輸入文字間距程式 Aoe1-113[討論]選取字串A及字串B,輸入文字間距程式 Ioaoe110[討論]選取字串A及字串B,輸入文字間距程式 2020-310[討論]選取字串A及字串B,輸入文字間距程式 Oiu15010[討論]選取字串A及字串B,輸入文字間距程式 2020-211[討論]選取字串A及字串B,輸入文字間距程式 Ia15010[討論]選取字串A及字串B,輸入文字間距程式 Aizyao10[討論]選取字串A及字串B,輸入文字間距程式 Uos15010[討論]選取字串A及字串B,輸入文字間距程式 BPl3tjj[討論]選取字串A及字串B,輸入文字間距程式 Ziao1510
[討論]選取字串A及字串B,輸入文字間距程式 Aoe15010[討論]選取字串A及字串B,輸入文字間距程式 Oo-2-110[討論]選取字串A及字串B,輸入文字間距程式 Zuoiy_10[討論]選取字串A及字串B,輸入文字間距程式 Aizyao11[討論]選取字串A及字串B,輸入文字間距程式 Iyb_1510[討論]選取字串A及字串B,輸入文字間距程式 Aoe1-112[討論]選取字串A及字串B,輸入文字間距程式 Uos15011[討論]選取字串A及字串B,輸入文字間距程式 Aoe2da10[討論]選取字串A及字串B,輸入文字間距程式 Aoe2da11[討論]選取字串A及字串B,輸入文字間距程式 Aoe10