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.
[已解決]請教一個標註LISP問題 Ioaoe110[已解決]請教一個標註LISP問題 2020-310[已解決]請教一個標註LISP問題 Oiu15010[已解決]請教一個標註LISP問題 2020-211[已解決]請教一個標註LISP問題 Ia15010[已解決]請教一個標註LISP問題 Aizyao10[已解決]請教一個標註LISP問題 Uos15010[已解決]請教一個標註LISP問題 BPl3tjj[已解決]請教一個標註LISP問題 Ziao1510
[已解決]請教一個標註LISP問題 Oo-2-110[已解決]請教一個標註LISP問題 Zuoiy_10[已解決]請教一個標註LISP問題 Aizyao11[已解決]請教一個標註LISP問題 Iyb_1510[已解決]請教一個標註LISP問題 Aoe1-111[已解決]請教一個標註LISP問題 Uos15011[已解決]請教一個標註LISP問題 Aoe2da10[已解決]請教一個標註LISP問題 Aoe2da11[已解決]請教一個標註LISP問題 Aoe10

[已解決]請教一個標註LISP問題

3 posters

向下

[已解決]請教一個標註LISP問題 Empty [已解決]請教一個標註LISP問題

發表 由 lcskc 2015-12-04, 12:22

這是我的程式,我要標一個尺寸是有固定公差的,執行沒問題,但是我如果只要標尺寸不要公差dimlinear還是會帶出公差
(defun C:qq(/ tpenter tmenter temptp)
 (setq tpenter "0.05")
 (setq tmenter "-0.02")
 (setq temptp "2")
 (command "dimtol" "on")
 (command "dimlinear" "dimtdec" temptp "dimtp" tpenter "dimtm" tmenter)  
 (princ)
)
所以我的想法是加這一行(command "dimtol" "OFF"),但是變沒公差了
(defun C:qq(/ tpenter tmenter temptp)
 (setq tpenter "0.05")
 (setq tmenter "-0.02")
 (setq temptp "2")
 (command "dimtol" "on")
 (command "dimlinear" "dimtdec" temptp "dimtp" tpenter "dimtm" tmenter)  
 (command "dimtol" "OFF")
 (princ)
)
請問這要如何改善?
感謝幫忙!!!


lcskc 在 2015-12-10, 20:12 作了第 1 次修改

____________________________________________________________________________________
[已解決]請教一個標註LISP問題 Acad2010 [已解決]請教一個標註LISP問題 Acad1810
[已解決]請教一個標註LISP問題 Acad1211[已解決]請教一個標註LISP問題 Acad1311[已解決]請教一個標註LISP問題 Acad1511
lcskc
lcskc
一般會員
一般會員

文章總數 : 59
年齡 : 51
來自 : 高雄
職業 : 模具
愛好 : pc相關
個性 : 安靜
使用年資 : 10
使用版本 : R12
經驗值 : 3934
威望值 : 31
注冊日期 : 2014-05-02
男 處女座 鼠

回頂端 向下

[已解決]請教一個標註LISP問題 Empty 回復: [已解決]請教一個標註LISP問題

發表 由 luswlife 2015-12-08, 22:28

我的建議是....你應該是設定二種標註的型式,而不是寫lisp
一種是有公差的標註型式,一種是無公差的...

因為你的程式,
第一個是將目前的標註型式 公差的功能打開...
第二個是打開後,又關閉,當然顯示不出來....((因為你把它關了))

____________________________________________________________________________________
[已解決]請教一個標註LISP問題 Ioaoe110 [已解決]請教一個標註LISP問題 Zuoiy_10 [已解決]請教一個標註LISP問題 2020-211 [已解決]請教一個標註LISP問題 Aizyao11 [已解決]請教一個標註LISP問題 Iyb_1510
[已解決]請教一個標註LISP問題 Aizyao10 [已解決]請教一個標註LISP問題 BPl3tjj.png [已解決]請教一個標註LISP問題 Ziao1510 [已解決]請教一個標註LISP問題 Oo-2-110 [已解決]請教一個標註LISP問題 Oooa_110
luswlife
luswlife
一般會員
一般會員

文章總數 : 103
年齡 : 45
來自 : 台北
職業 : 繪圖
愛好 : 吃喝玩樂
個性 : 怪異
使用年資 : 10年
使用版本 : 2014
積分 : 4
最佳解答 : 1
經驗值 : 5630
威望值 : 132
注冊日期 : 2010-01-28
2D基礎函授 顧問外掛程式 經典問與答讀者 藍鵲414號
2015聚會勳章 2016聚會勳章 女 射手座 馬

回頂端 向下

[已解決]請教一個標註LISP問題 Empty 回復: [已解決]請教一個標註LISP問題

發表 由 lcskc 2015-12-09, 07:50

感謝,試了一下用標註型式是可以
(defun c:qq3()
(command "dimstyle" "r" "iso-25-3")
(command "dimlinear")
(command "dimstyle" "standard")
(princ)
)
但是 (command "dimstyle" "standard")無法變回原先的標註型式,這有解嗎?
感謝!!!

____________________________________________________________________________________
[已解決]請教一個標註LISP問題 Acad2010 [已解決]請教一個標註LISP問題 Acad1810
[已解決]請教一個標註LISP問題 Acad1211[已解決]請教一個標註LISP問題 Acad1311[已解決]請教一個標註LISP問題 Acad1511
lcskc
lcskc
一般會員
一般會員

文章總數 : 59
年齡 : 51
來自 : 高雄
職業 : 模具
愛好 : pc相關
個性 : 安靜
使用年資 : 10
使用版本 : R12
經驗值 : 3934
威望值 : 31
注冊日期 : 2014-05-02
男 處女座 鼠

回頂端 向下

[已解決]請教一個標註LISP問題 Empty 回復: [已解決]請教一個標註LISP問題

發表 由 luswlife 2015-12-09, 10:50

因為你中間少了"r"
你切換到iso-25-3時前面加了"r"
當然切換回來就要加.... 嘆氣

____________________________________________________________________________________
[已解決]請教一個標註LISP問題 Ioaoe110 [已解決]請教一個標註LISP問題 Zuoiy_10 [已解決]請教一個標註LISP問題 2020-211 [已解決]請教一個標註LISP問題 Aizyao11 [已解決]請教一個標註LISP問題 Iyb_1510
[已解決]請教一個標註LISP問題 Aizyao10 [已解決]請教一個標註LISP問題 BPl3tjj.png [已解決]請教一個標註LISP問題 Ziao1510 [已解決]請教一個標註LISP問題 Oo-2-110 [已解決]請教一個標註LISP問題 Oooa_110
luswlife
luswlife
一般會員
一般會員

文章總數 : 103
年齡 : 45
來自 : 台北
職業 : 繪圖
愛好 : 吃喝玩樂
個性 : 怪異
使用年資 : 10年
使用版本 : 2014
積分 : 4
最佳解答 : 1
經驗值 : 5630
威望值 : 132
注冊日期 : 2010-01-28
2D基礎函授 顧問外掛程式 經典問與答讀者 藍鵲414號
2015聚會勳章 2016聚會勳章 女 射手座 馬

回頂端 向下

[已解決]請教一個標註LISP問題 Empty 回復: [已解決]請教一個標註LISP問題

發表 由 lcskc 2015-12-09, 12:14

加了沒用耶???
(defun c:qq3()
(command "dimstyle" "r" "iso-25-3")
(command "dimlinear")
(command "dimstyle" "r" "iso-25")
(princ)
)
變不回來!!!

____________________________________________________________________________________
[已解決]請教一個標註LISP問題 Acad2010 [已解決]請教一個標註LISP問題 Acad1810
[已解決]請教一個標註LISP問題 Acad1211[已解決]請教一個標註LISP問題 Acad1311[已解決]請教一個標註LISP問題 Acad1511
lcskc
lcskc
一般會員
一般會員

文章總數 : 59
年齡 : 51
來自 : 高雄
職業 : 模具
愛好 : pc相關
個性 : 安靜
使用年資 : 10
使用版本 : R12
經驗值 : 3934
威望值 : 31
注冊日期 : 2014-05-02
男 處女座 鼠

回頂端 向下

[已解決]請教一個標註LISP問題 Empty 回復: [已解決]請教一個標註LISP問題

發表 由 luswlife 2015-12-09, 16:31

(defun c:qq3()
 (setq p1(getpoint "\n 第一點"))
 (setq p2(getpoint "\n 第二點"))
 (setq p3(getpoint "\n 第三點"))

 (command "dimstyle" "r" "iso-25-3")
 (command "dimlinear" p1 p2 p3)
 (command "dimstyle" "r" "iso-25")
 (princ)
 )

____________________________________________________________________________________
[已解決]請教一個標註LISP問題 Ioaoe110 [已解決]請教一個標註LISP問題 Zuoiy_10 [已解決]請教一個標註LISP問題 2020-211 [已解決]請教一個標註LISP問題 Aizyao11 [已解決]請教一個標註LISP問題 Iyb_1510
[已解決]請教一個標註LISP問題 Aizyao10 [已解決]請教一個標註LISP問題 BPl3tjj.png [已解決]請教一個標註LISP問題 Ziao1510 [已解決]請教一個標註LISP問題 Oo-2-110 [已解決]請教一個標註LISP問題 Oooa_110
luswlife
luswlife
一般會員
一般會員

文章總數 : 103
年齡 : 45
來自 : 台北
職業 : 繪圖
愛好 : 吃喝玩樂
個性 : 怪異
使用年資 : 10年
使用版本 : 2014
積分 : 4
最佳解答 : 1
經驗值 : 5630
威望值 : 132
注冊日期 : 2010-01-28
2D基礎函授 顧問外掛程式 經典問與答讀者 藍鵲414號
2015聚會勳章 2016聚會勳章 女 射手座 馬

回頂端 向下

[已解決]請教一個標註LISP問題 Empty 回復: [已解決]請教一個標註LISP問題

發表 由 lcskc 2015-12-09, 18:16

luswlife 寫到:(defun c:qq3()
 (setq p1(getpoint "\n 第一點"))
 (setq p2(getpoint "\n 第二點"))
 (setq p3(getpoint "\n 第三點"))

 (command "dimstyle" "r" "iso-25-3")
 (command "dimlinear" p1 p2 p3)
 (command "dimstyle" "r" "iso-25")
 (princ)
 )

不一樣的思維,但是是可以符合需求的,還要好好研究,感謝!

不過還是要在問一下,如果要像我開始問得那樣,用設定上下限公差值的方式有辦法做到嗎?
因為如果用標註型式的方式,可能要設十幾個==!
感謝!

____________________________________________________________________________________
[已解決]請教一個標註LISP問題 Acad2010 [已解決]請教一個標註LISP問題 Acad1810
[已解決]請教一個標註LISP問題 Acad1211[已解決]請教一個標註LISP問題 Acad1311[已解決]請教一個標註LISP問題 Acad1511
lcskc
lcskc
一般會員
一般會員

文章總數 : 59
年齡 : 51
來自 : 高雄
職業 : 模具
愛好 : pc相關
個性 : 安靜
使用年資 : 10
使用版本 : R12
經驗值 : 3934
威望值 : 31
注冊日期 : 2014-05-02
男 處女座 鼠

回頂端 向下

[已解決]請教一個標註LISP問題 Empty 回復: [已解決]請教一個標註LISP問題

發表 由 luswlife 2015-12-09, 22:55

先說明一下
不是不一樣的思維,而是語法錯誤
因為
原本的你執行的(command "dimlinear")<==指令不完整,
在執行標註的指令後要給二個端點位置,及放置標註的位置,
你因為沒有給後面就執行(command "dimstyle" "r" "iso-25"),所以出現了錯誤訊息,因此不成功

另外你先前問的~可以執行,加工一下

(defun C:qq(/ tpenter tmenter temptp)
(setq tpenter(getreal "\n 輸入上限值:"))
(setq tmenter(getreal "\n 輸入下限值:"))
(setq temptp (getint "\n 輸入小數點位數:"))
(setq p1(getpoint "\n 第一點:"))
(setq p2(getpoint "\n 第二點:"))
(setq p3(getpoint "\n 第三點:"))
(command "dimstyle" "r" "iso-25-3")
(command "dimtol" "on")
(command "dimlinear" "dimtdec" temptp "dimtp" tpenter "dimtm" tmenter p1 p2 p3)
(command "dimstyle" "r" "iso-25")
(princ)
)

以上給你參考,可自行調整需求,太難的要求就不行了,要等其他高手幫忙嚕

____________________________________________________________________________________
[已解決]請教一個標註LISP問題 Ioaoe110 [已解決]請教一個標註LISP問題 Zuoiy_10 [已解決]請教一個標註LISP問題 2020-211 [已解決]請教一個標註LISP問題 Aizyao11 [已解決]請教一個標註LISP問題 Iyb_1510
[已解決]請教一個標註LISP問題 Aizyao10 [已解決]請教一個標註LISP問題 BPl3tjj.png [已解決]請教一個標註LISP問題 Ziao1510 [已解決]請教一個標註LISP問題 Oo-2-110 [已解決]請教一個標註LISP問題 Oooa_110
luswlife
luswlife
一般會員
一般會員

文章總數 : 103
年齡 : 45
來自 : 台北
職業 : 繪圖
愛好 : 吃喝玩樂
個性 : 怪異
使用年資 : 10年
使用版本 : 2014
積分 : 4
最佳解答 : 1
經驗值 : 5630
威望值 : 132
注冊日期 : 2010-01-28
2D基礎函授 顧問外掛程式 經典問與答讀者 藍鵲414號
2015聚會勳章 2016聚會勳章 女 射手座 馬

回頂端 向下

[已解決]請教一個標註LISP問題 Empty 回復: [已解決]請教一個標註LISP問題

發表 由 lcskc 2015-12-10, 06:05

感謝熱心指導!
可能我表達的不是很好,我所謂不一樣思維是說用標註型式的方式和我一開始問的那種方式,
你用的這些使用標註型式的方法我都照著試了ok沒問題,可以正常使用.

我要請教的是為何下面這種方式公差不顯示
代碼:

(defun C:qq(/ tpenter tmenter temptp)
 (setq tpenter "0.05")
 (setq tmenter "-0.02")
 (setq temptp "2")
 (command "dimtol" "on")
 (command "dimlinear" "dimtdec" temptp "dimtp" tpenter "dimtm" tmenter)
 (command "dimtol" "OFF") 
 (princ)
)
 (command "dimtol" "OFF") 這一行如果沒有,公差顯示ok,但單純執行dimlinear標註時會帶出剛剛的公差(因為dimtol沒關),
(command "dimtol" "OFF")如果加這一行,他把公差關了,但上一行的標註為何會被關掉一直搞不懂,明明不同行,
我試著手動方式在cad裡執行lisp步驟
公差上限dimtp
公差下限dimtm
打開公差dimtol on
標註 (ok 正常執行)
關閉公差顯示
標註 (ok 沒公差)
手動方式正常,不知怎麼把手動過程寫成lisp變不正常,一直搞不定!



____________________________________________________________________________________
[已解決]請教一個標註LISP問題 Acad2010 [已解決]請教一個標註LISP問題 Acad1810
[已解決]請教一個標註LISP問題 Acad1211[已解決]請教一個標註LISP問題 Acad1311[已解決]請教一個標註LISP問題 Acad1511
lcskc
lcskc
一般會員
一般會員

文章總數 : 59
年齡 : 51
來自 : 高雄
職業 : 模具
愛好 : pc相關
個性 : 安靜
使用年資 : 10
使用版本 : R12
經驗值 : 3934
威望值 : 31
注冊日期 : 2014-05-02
男 處女座 鼠

回頂端 向下

[已解決]請教一個標註LISP問題 Empty 回復: [已解決]請教一個標註LISP問題

發表 由 shenhung 2015-12-10, 07:52

.把公差系統變數先用setvar 設定好..再執行dimlinear 就可正常運作.
pause 會讓LISP先暫停讓操作者輸入後.後面才會再繼續執行.
(defun C:qq()
(setvar "dimtp" 0.05)
(setvar "dimtm" -0.02)
(setvar "dimtdec" 2)
(command "dimtol" "on")
(command "dimlinear" pause pause pause )
(command "dimtol" "off")
(princ)
)

____________________________________________________________________________________
[已解決]請教一個標註LISP問題 Ioaoe110 [已解決]請教一個標註LISP問題 Zuoiy_10 [已解決]請教一個標註LISP問題 2020-211 [已解決]請教一個標註LISP問題 Aizyao11 [已解決]請教一個標註LISP問題 Iyb_1510
[已解決]請教一個標註LISP問題 Aizyao10 [已解決]請教一個標註LISP問題 BPl3tjj.png [已解決]請教一個標註LISP問題 Ziao1510 [已解決]請教一個標註LISP問題 Oo-2-110 [已解決]請教一個標註LISP問題 Oooa_110
shenhung
shenhung
高級會員
高級會員

文章總數 : 272
年齡 : 57
來自 : 新北市
職業 : 塑膠模具設計.AUTOLISP
愛好 : 音樂
個性 : 隨和
使用年資 : 18年
使用版本 : 2010
積分 : 15
經驗值 : 7761
威望值 : 1157
注冊日期 : 2009-06-03
男 摩羯座 馬

回頂端 向下

[已解決]請教一個標註LISP問題 Empty 回復: [已解決]請教一個標註LISP問題

發表 由 lcskc 2015-12-10, 20:12

shenhung 寫到:.把公差系統變數先用setvar 設定好..再執行dimlinear 就可正常運作.
pause 會讓LISP先暫停讓操作者輸入後.後面才會再繼續執行.
(defun C:qq()
(setvar "dimtp" 0.05)
(setvar "dimtm" -0.02)
(setvar "dimtdec" 2)
(command "dimtol" "on")
(command "dimlinear"  pause pause pause )
(command "dimtol" "off")
(princ)
)

好厲害,解決我一開始的困擾了,感謝!
也感謝 luswlife 的幫忙!

____________________________________________________________________________________
[已解決]請教一個標註LISP問題 Acad2010 [已解決]請教一個標註LISP問題 Acad1810
[已解決]請教一個標註LISP問題 Acad1211[已解決]請教一個標註LISP問題 Acad1311[已解決]請教一個標註LISP問題 Acad1511
lcskc
lcskc
一般會員
一般會員

文章總數 : 59
年齡 : 51
來自 : 高雄
職業 : 模具
愛好 : pc相關
個性 : 安靜
使用年資 : 10
使用版本 : R12
經驗值 : 3934
威望值 : 31
注冊日期 : 2014-05-02
男 處女座 鼠

回頂端 向下

回頂端


 
這個論壇的權限:
無法 在這個版面回復文章
[已解決]請教一個標註LISP問題 Ioaoe110[已解決]請教一個標註LISP問題 2020-310[已解決]請教一個標註LISP問題 Oiu15010[已解決]請教一個標註LISP問題 2020-211[已解決]請教一個標註LISP問題 Ia15010[已解決]請教一個標註LISP問題 Aizyao10[已解決]請教一個標註LISP問題 Uos15010[已解決]請教一個標註LISP問題 BPl3tjj[已解決]請教一個標註LISP問題 Ziao1510
[已解決]請教一個標註LISP問題 Oo-2-110[已解決]請教一個標註LISP問題 Zuoiy_10[已解決]請教一個標註LISP問題 Aizyao11[已解決]請教一個標註LISP問題 Iyb_1510[已解決]請教一個標註LISP問題 Aoe1-111[已解決]請教一個標註LISP問題 Uos15011[已解決]請教一個標註LISP問題 Aoe2da10[已解決]請教一個標註LISP問題 Aoe2da11[已解決]請教一個標註LISP問題 Aoe10