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.
關於目前圖面路徑及檔名 Ioaoe110關於目前圖面路徑及檔名 2020-310關於目前圖面路徑及檔名 Oiu15010關於目前圖面路徑及檔名 2020-211關於目前圖面路徑及檔名 Ia15010關於目前圖面路徑及檔名 Aizyao10關於目前圖面路徑及檔名 Uos15010關於目前圖面路徑及檔名 BPl3tjj關於目前圖面路徑及檔名 Ziao1510
關於目前圖面路徑及檔名 Oo-2-110關於目前圖面路徑及檔名 Zuoiy_10關於目前圖面路徑及檔名 Aizyao11關於目前圖面路徑及檔名 Iyb_1510關於目前圖面路徑及檔名 Aoe1-111關於目前圖面路徑及檔名 Uos15011關於目前圖面路徑及檔名 Aoe2da10關於目前圖面路徑及檔名 Aoe2da11關於目前圖面路徑及檔名 Aoe10

關於目前圖面路徑及檔名

3 posters

向下

關於目前圖面路徑及檔名 Empty 關於目前圖面路徑及檔名

發表 由 hoodpinrh0829 2018-11-25, 11:56

向大大請教一下,
我想要取得目前圖面儲存的路徑,有什麼系統變數或指令嗎?
因我想搭配”-WBLOCK“指令。

____________________________________________________________________________________
關於目前圖面路徑及檔名 Ioaoe110 關於目前圖面路徑及檔名 Zuoiy_10 關於目前圖面路徑及檔名 2020-211 關於目前圖面路徑及檔名 Aizyao11 關於目前圖面路徑及檔名 Iyb_1510
關於目前圖面路徑及檔名 Aizyao10 關於目前圖面路徑及檔名 BPl3tjj.png 關於目前圖面路徑及檔名 Ziao1510 關於目前圖面路徑及檔名 Oo-2-110 關於目前圖面路徑及檔名 Oooa_110
hoodpinrh0829
hoodpinrh0829
一般會員
一般會員

文章總數 : 75
年齡 : 41
來自 : 桃園
職業 : 板金
愛好 : 到處走走
個性 : 內向
使用年資 : 5年以上
使用版本 : 2019
經驗值 : 4143
威望值 : 0
注冊日期 : 2014-02-27
男 處女座 狗

回頂端 向下

關於目前圖面路徑及檔名 Empty 回復: 關於目前圖面路徑及檔名

發表 由 Tiger&蘋果爸 2018-11-26, 09:57

可以使用 DWGPREFIX (系統變數)
竊喜

____________________________________________________________________________________
👉[好康]🎁加入專屬B取得大補帖及看2D+3D影片(點我)👈
關於目前圖面路徑及檔名 Sesa2011 關於目前圖面路徑及檔名 Youtub11 關於目前圖面路徑及檔名 Oiea2011 關於目前圖面路徑及檔名 Oe20011 關於目前圖面路徑及檔名 Fbi20011 關於目前圖面路徑及檔名 Line2011
Tiger&蘋果爸
Tiger&蘋果爸
系統管理員
系統管理員

文章總數 : 21107
年齡 : 48
來自 : 台北市文山區
職業 : AutoCAD顧問
愛好 : 蹓狗/戶外活動/拍照/吸貓
個性 : 幽默/樂觀/善良
使用年資 : 20↑
使用版本 : AutoCAD 2022
經驗值 : 88611
威望值 : 16958
注冊日期 : 2008-04-23
2D基礎函授 2D進階函授 3D基礎函授 https://i.servimg.com/u/f11/19/71/67/71/2d3d10.png2D+3D線上 顧問外掛程式 經典問與答讀者 藍鵲1號
2009聚會勳章 2010聚會勳章 2011聚會勳章 2012聚會勳章 2013勳章-2D基礎 2014聚會勳章 2015聚會勳章 2016聚會勳章 串連貼紙成功 男 水瓶座 兔

http://mypaper.pchome.com.tw/kv1012tiger

回頂端 向下

關於目前圖面路徑及檔名 Empty 回復: 關於目前圖面路徑及檔名

發表 由 hoodpinrh0829 2018-11-26, 19:09

Tiger&蘋果爸 寫到:可以使用 DWGPREFIX (系統變數)
竊喜



感謝蘋果爸

____________________________________________________________________________________
關於目前圖面路徑及檔名 Ioaoe110 關於目前圖面路徑及檔名 Zuoiy_10 關於目前圖面路徑及檔名 2020-211 關於目前圖面路徑及檔名 Aizyao11 關於目前圖面路徑及檔名 Iyb_1510
關於目前圖面路徑及檔名 Aizyao10 關於目前圖面路徑及檔名 BPl3tjj.png 關於目前圖面路徑及檔名 Ziao1510 關於目前圖面路徑及檔名 Oo-2-110 關於目前圖面路徑及檔名 Oooa_110
hoodpinrh0829
hoodpinrh0829
一般會員
一般會員

文章總數 : 75
年齡 : 41
來自 : 桃園
職業 : 板金
愛好 : 到處走走
個性 : 內向
使用年資 : 5年以上
使用版本 : 2019
經驗值 : 4143
威望值 : 0
注冊日期 : 2014-02-27
男 處女座 狗

回頂端 向下

關於目前圖面路徑及檔名 Empty 回復: 關於目前圖面路徑及檔名

發表 由 hoodpinrh0829 2018-11-30, 08:40

有大大可以分享
autocad 2019 -wblock指令 在lisp如何使用嗎?
這個lisp 差在 指令-wblock。

____________________________________________________________________________________
關於目前圖面路徑及檔名 Ioaoe110 關於目前圖面路徑及檔名 Zuoiy_10 關於目前圖面路徑及檔名 2020-211 關於目前圖面路徑及檔名 Aizyao11 關於目前圖面路徑及檔名 Iyb_1510
關於目前圖面路徑及檔名 Aizyao10 關於目前圖面路徑及檔名 BPl3tjj.png 關於目前圖面路徑及檔名 Ziao1510 關於目前圖面路徑及檔名 Oo-2-110 關於目前圖面路徑及檔名 Oooa_110
hoodpinrh0829
hoodpinrh0829
一般會員
一般會員

文章總數 : 75
年齡 : 41
來自 : 桃園
職業 : 板金
愛好 : 到處走走
個性 : 內向
使用年資 : 5年以上
使用版本 : 2019
經驗值 : 4143
威望值 : 0
注冊日期 : 2014-02-27
男 處女座 狗

回頂端 向下

關於目前圖面路徑及檔名 Empty 回復: 關於目前圖面路徑及檔名

發表 由 naruto018 2018-11-30, 09:50

常用
command
(command "-wblock" .....)

其他類似
vl-cmdf
naruto018
naruto018
中級會員
中級會員

文章總數 : 207
年齡 : 32
來自 : 高雄
職業 : 學習中(CAD,Revit,Excel VBA)
愛好 : 當個懶熊
個性 : 內向
使用年資 : 新手
使用版本 : 2015
AutoCAD基礎篇等級 : 10星級
積分 : 5
經驗值 : 4226
威望值 : 558
注冊日期 : 2016-11-29
藍鵲726號
男 摩羯座 羊

回頂端 向下

關於目前圖面路徑及檔名 Empty 回復: 關於目前圖面路徑及檔名

發表 由 hoodpinrh0829 2018-11-30, 12:26

naruto018 寫到:常用
command
(command "-wblock" .....)

其他類似
vl-cmdf


感謝 我來試試

____________________________________________________________________________________
關於目前圖面路徑及檔名 Ioaoe110 關於目前圖面路徑及檔名 Zuoiy_10 關於目前圖面路徑及檔名 2020-211 關於目前圖面路徑及檔名 Aizyao11 關於目前圖面路徑及檔名 Iyb_1510
關於目前圖面路徑及檔名 Aizyao10 關於目前圖面路徑及檔名 BPl3tjj.png 關於目前圖面路徑及檔名 Ziao1510 關於目前圖面路徑及檔名 Oo-2-110 關於目前圖面路徑及檔名 Oooa_110
hoodpinrh0829
hoodpinrh0829
一般會員
一般會員

文章總數 : 75
年齡 : 41
來自 : 桃園
職業 : 板金
愛好 : 到處走走
個性 : 內向
使用年資 : 5年以上
使用版本 : 2019
經驗值 : 4143
威望值 : 0
注冊日期 : 2014-02-27
男 處女座 狗

回頂端 向下

關於目前圖面路徑及檔名 Empty 回復: 關於目前圖面路徑及檔名

發表 由 hoodpinrh0829 2018-12-01, 23:41

(defun c:tt()
(command "filedia" 0)
(setq path(getvar "dwgprefix"))
(setq i 0)
(whlie text1
(setq text1(entsel "\n選取儲存檔名:"))
(setq pt1(getpoint "\n窗選該物件:"))
(setq pt2(getcorner pt1 "\n"))
(setq ss (ssget "w" pt1 pt2))
(setq text1_data (entget (car text1)))
(setq text1_type (cdr (assoc 0 text_data)))
(if (= text1_type "text")
(progn
(setq text2_data(cdr (assoc 1 text1_data)))
(setq text3_data (cdr (assoc 10 text1_data)))
(setq i (1+ i))
(command "-wblock" (strcat path text2_data) "" text3_data ss "")
;;;各位大大,我就差在-wblock這個指令,我用的版本是2019版的。
;;;我是參考蘋果爸的 https://www.autocad-tw.com/t1779-topic?highlight=wblock
(command "oops" "")
)
(alert "選錯啦!!!")
)
(setq text1(entsel "\n選取儲存該物件的檔名:")
)
(princ (strcar "\n共轉了 "(itoa i )" 個檔" ))
(command "filedia" 1)
(prin1)
)

就差在-wblock ,請大大指點。
火冒三丈 火冒三丈 火冒三丈

____________________________________________________________________________________
關於目前圖面路徑及檔名 Ioaoe110 關於目前圖面路徑及檔名 Zuoiy_10 關於目前圖面路徑及檔名 2020-211 關於目前圖面路徑及檔名 Aizyao11 關於目前圖面路徑及檔名 Iyb_1510
關於目前圖面路徑及檔名 Aizyao10 關於目前圖面路徑及檔名 BPl3tjj.png 關於目前圖面路徑及檔名 Ziao1510 關於目前圖面路徑及檔名 Oo-2-110 關於目前圖面路徑及檔名 Oooa_110
hoodpinrh0829
hoodpinrh0829
一般會員
一般會員

文章總數 : 75
年齡 : 41
來自 : 桃園
職業 : 板金
愛好 : 到處走走
個性 : 內向
使用年資 : 5年以上
使用版本 : 2019
經驗值 : 4143
威望值 : 0
注冊日期 : 2014-02-27
男 處女座 狗

回頂端 向下

關於目前圖面路徑及檔名 Empty 回復: 關於目前圖面路徑及檔名

發表 由 naruto018 2018-12-03, 08:50

hoodpinrh0829 寫到:(defun c:tt()
(command "filedia" 0)
(setq path(getvar "dwgprefix"))
(setq i 0)
(whlie text1
(setq text1(entsel "\n選取儲存檔名:"))
(setq pt1(getpoint "\n窗選該物件:"))
(setq pt2(getcorner pt1 "\n"))
(setq ss (ssget "w" pt1 pt2))
(setq text1_data (entget (car text1)))
(setq text1_type (cdr (assoc 0 text_data)))
(if (= text1_type "text")
(progn
(setq text2_data(cdr (assoc 1 text1_data)))
(setq text3_data (cdr (assoc 10 text1_data)))
(setq i (1+ i))
(command "-wblock" (strcat path text2_data) "" text3_data ss "")
;;;各位大大,我就差在-wblock這個指令,我用的版本是2019版的。
;;;我是參考蘋果爸的 https://www.autocad-tw.com/t1779-topic?highlight=wblock
(command "oops" "")
)
(alert "選錯啦!!!")
)
(setq text1(entsel "\n選取儲存該物件的檔名:")
)
(princ (strcar "\n共轉了 "(itoa i )" 個檔" ))
(command "filedia" 1)
(prin1)
)

就差在-wblock ,請大大指點。
火冒三丈 火冒三丈 火冒三丈

錯誤原因不是-wblock的問題
是因為你的有一些關鍵字或變數名稱在打錯
和一些括弧沒對稱
稍微幫你修改,如下
代碼:
(defun c:tt  ( / path i text1 ss text1_data text1_type text2_data text3_data)
;;;    (command "filedia" 0);好像沒必要
    (setq path (getvar "dwgprefix"))
    (setq i 0)
    (while (and
         (setq text1 (entsel "\n選取儲存檔名:"))
         (princ "\n選取該物件:")
         (setq ss (ssget)))
;;;   (setq pt1 (getpoint "\n窗選該物件:"));放到前面去
;;;   (setq pt2 (getcorner pt1 "\n"))
;;;   (setq ss (ssget "w" pt1 pt2))
   (setq text1_data (entget (car text1)))
   (setq text1_type (cdr (assoc 0 text1_data)))
   (if (= text1_type "TEXT")   
       (progn
      (setq text2_data (cdr (assoc 1 text1_data)))
      (setq text3_data (cdr (assoc 10 text1_data)))
      (setq i (1+ i))
      (command "-wblock"
          (strcat path text2_data)
          ""
          text3_data
          ss
          "")
;;;各位大大,我就差在-wblock這個指令,我用的版本是2019版的。
;;;我是參考蘋果爸的 http://www.autocad-tw.com/t1779-topic?highlight=wblock
      (command "oops")
      )
       (alert "選錯啦!!!")
       )
   )
    (princ (strcat "\n共轉了 " (itoa i) " 個檔"))
;;;    (command "filedia" 1);好像沒必要
    (princ)
    )

naruto018
naruto018
中級會員
中級會員

文章總數 : 207
年齡 : 32
來自 : 高雄
職業 : 學習中(CAD,Revit,Excel VBA)
愛好 : 當個懶熊
個性 : 內向
使用年資 : 新手
使用版本 : 2015
AutoCAD基礎篇等級 : 10星級
積分 : 5
經驗值 : 4226
威望值 : 558
注冊日期 : 2016-11-29
藍鵲726號
男 摩羯座 羊

回頂端 向下

關於目前圖面路徑及檔名 Empty 回復: 關於目前圖面路徑及檔名

發表 由 hoodpinrh0829 2018-12-03, 13:02

naruto018 寫到:
hoodpinrh0829 寫到:(defun c:tt()
(command "filedia" 0)
(setq path(getvar "dwgprefix"))
(setq i 0)
(whlie text1
(setq text1(entsel "\n選取儲存檔名:"))
(setq pt1(getpoint "\n窗選該物件:"))
(setq pt2(getcorner pt1 "\n"))
(setq ss (ssget "w" pt1 pt2))
(setq text1_data (entget (car text1)))
(setq text1_type (cdr (assoc 0 text_data)))
(if (= text1_type "text")
(progn
(setq text2_data(cdr (assoc 1 text1_data)))
(setq text3_data (cdr (assoc 10 text1_data)))
(setq i (1+ i))
(command "-wblock" (strcat path text2_data) "" text3_data ss "")
;;;各位大大,我就差在-wblock這個指令,我用的版本是2019版的。
;;;我是參考蘋果爸的 https://www.autocad-tw.com/t1779-topic?highlight=wblock
(command "oops" "")
)
(alert "選錯啦!!!")
)
(setq text1(entsel "\n選取儲存該物件的檔名:")
)
(princ (strcar "\n共轉了 "(itoa i )" 個檔" ))
(command "filedia" 1)
(prin1)
)

就差在-wblock ,請大大指點。
火冒三丈 火冒三丈 火冒三丈

錯誤原因不是-wblock的問題
是因為你的有一些關鍵字或變數名稱在打錯
和一些括弧沒對稱
稍微幫你修改,如下
代碼:
(defun c:tt  ( / path i text1 ss text1_data text1_type text2_data text3_data)
;;;    (command "filedia" 0);好像沒必要
    (setq path (getvar "dwgprefix"))
    (setq i 0)
    (while (and
       (setq text1 (entsel "\n選取儲存檔名:"))
       (princ "\n選取該物件:")
       (setq ss (ssget)))
;;; (setq pt1 (getpoint "\n窗選該物件:"));放到前面去
;;; (setq pt2 (getcorner pt1 "\n"))
;;; (setq ss (ssget "w" pt1 pt2))
 (setq text1_data (entget (car text1)))
 (setq text1_type (cdr (assoc 0 text1_data)))
 (if (= text1_type "TEXT")
    (progn
 (setq text2_data (cdr (assoc 1 text1_data)))
 (setq text3_data (cdr (assoc 10 text1_data)))
 (setq i (1+ i))
 (command "-wblock"
 (strcat path text2_data)
 ""
 text3_data
 ss
 "")
;;;各位大大,我就差在-wblock這個指令,我用的版本是2019版的。
;;;我是參考蘋果爸的 http://www.autocad-tw.com/t1779-topic?highlight=wblock
 (command "oops")
 )
    (alert "選錯啦!!!")
    )
 )
    (princ (strcat "\n共轉了 " (itoa i) " 個檔"))
;;;    (command "filedia" 1);好像沒必要
    (princ)
    )

竊喜 感謝大大的幫忙,我等等來測試看看。
我用手機寫的,沒法即時測試對不對或是少了什麼。

____________________________________________________________________________________
關於目前圖面路徑及檔名 Ioaoe110 關於目前圖面路徑及檔名 Zuoiy_10 關於目前圖面路徑及檔名 2020-211 關於目前圖面路徑及檔名 Aizyao11 關於目前圖面路徑及檔名 Iyb_1510
關於目前圖面路徑及檔名 Aizyao10 關於目前圖面路徑及檔名 BPl3tjj.png 關於目前圖面路徑及檔名 Ziao1510 關於目前圖面路徑及檔名 Oo-2-110 關於目前圖面路徑及檔名 Oooa_110
hoodpinrh0829
hoodpinrh0829
一般會員
一般會員

文章總數 : 75
年齡 : 41
來自 : 桃園
職業 : 板金
愛好 : 到處走走
個性 : 內向
使用年資 : 5年以上
使用版本 : 2019
經驗值 : 4143
威望值 : 0
注冊日期 : 2014-02-27
男 處女座 狗

回頂端 向下

關於目前圖面路徑及檔名 Empty 回復: 關於目前圖面路徑及檔名

發表 由 hoodpinrh0829 2018-12-04, 12:23

(defun c:tt (/ path i text1 ss text1_data text1_type text2_data
    text3_data)
 (setq path (getvar "dwgprefix"))
 (setq i 0)
 (while (and

  (setq text1 (entsel "\n選取儲存檔名:"));;;這裡開始我要個別把物件轉出不能移出while外。目前檔名的部份只對單行文字有用,我會在改進讓他對各種文字有用。
  (princ "\n選取該物件:")
  (setq pt1 (getpoint "\n窗選該物件:"))
  (setq pt2 (getcorner pt1 ));;;這裡開始結束

  (setq ss (ssget "w" pt1 pt2))
;;;   (setq ss (ssget))
)
   (setq text1_data (entget (car text1)))
   (setq text1_type (cdr (assoc 0 text1_data)))
   (if (= text1_type "TEXT")
     (progn
(setq text2_data (cdr (assoc 1 text1_data)))
(setq text3_data (cdr (assoc 10 text1_data)))
(setq i (1+ i))
(command "-wblock"
(strcat path text2_data)
""
text3_data
ss
""
)
(command "undo" 2);;;這裡有改原本oopd,autocad 一直顯示叫我改用undo
     )
     (alert "選錯啦!!!")
   )
 )
 (princ (strcat "\n共轉了 " (itoa i) " 個檔"))
 (princ)
)




我目前測試都正常。
非常感謝大大的幫忙,感恩。
竊喜 竊喜 竊喜
這個小東西可以讓我不用一直使用wblock指令,由其是在一張圖裡有一堆小物件時最好用。

____________________________________________________________________________________
關於目前圖面路徑及檔名 Ioaoe110 關於目前圖面路徑及檔名 Zuoiy_10 關於目前圖面路徑及檔名 2020-211 關於目前圖面路徑及檔名 Aizyao11 關於目前圖面路徑及檔名 Iyb_1510
關於目前圖面路徑及檔名 Aizyao10 關於目前圖面路徑及檔名 BPl3tjj.png 關於目前圖面路徑及檔名 Ziao1510 關於目前圖面路徑及檔名 Oo-2-110 關於目前圖面路徑及檔名 Oooa_110
hoodpinrh0829
hoodpinrh0829
一般會員
一般會員

文章總數 : 75
年齡 : 41
來自 : 桃園
職業 : 板金
愛好 : 到處走走
個性 : 內向
使用年資 : 5年以上
使用版本 : 2019
經驗值 : 4143
威望值 : 0
注冊日期 : 2014-02-27
男 處女座 狗

回頂端 向下

回頂端


 
這個論壇的權限:
無法 在這個版面回復文章
關於目前圖面路徑及檔名 Ioaoe110關於目前圖面路徑及檔名 2020-310關於目前圖面路徑及檔名 Oiu15010關於目前圖面路徑及檔名 2020-211關於目前圖面路徑及檔名 Ia15010關於目前圖面路徑及檔名 Aizyao10關於目前圖面路徑及檔名 Uos15010關於目前圖面路徑及檔名 BPl3tjj關於目前圖面路徑及檔名 Ziao1510
關於目前圖面路徑及檔名 Oo-2-110關於目前圖面路徑及檔名 Zuoiy_10關於目前圖面路徑及檔名 Aizyao11關於目前圖面路徑及檔名 Iyb_1510關於目前圖面路徑及檔名 Aoe1-111關於目前圖面路徑及檔名 Uos15011關於目前圖面路徑及檔名 Aoe2da10關於目前圖面路徑及檔名 Aoe2da11關於目前圖面路徑及檔名 Aoe10