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.
〔問題〕交通標線 Aoe1-113〔問題〕交通標線 Ioaoe110〔問題〕交通標線 2020-310〔問題〕交通標線 Oiu15010〔問題〕交通標線 2020-211〔問題〕交通標線 Ia15010〔問題〕交通標線 Aizyao10〔問題〕交通標線 Uos15010〔問題〕交通標線 BPl3tjj〔問題〕交通標線 Ziao1510
〔問題〕交通標線 Aoe15010〔問題〕交通標線 Oo-2-110〔問題〕交通標線 Zuoiy_10〔問題〕交通標線 Aizyao11〔問題〕交通標線 Iyb_1510〔問題〕交通標線 Aoe1-112〔問題〕交通標線 Uos15011〔問題〕交通標線 Aoe2da10〔問題〕交通標線 Aoe2da11〔問題〕交通標線 Aoe10

〔問題〕交通標線

3 posters

向下

〔問題〕交通標線 Empty 〔問題〕交通標線

發表 由 Lasoireearx 周一 16 8月 2021 - 12:02

最近公司接了一段公路的設計案件,其中道路線採用黃線設計
依據法規來說是線長為四公尺 間隔六公尺的線段設計
道路實際呈現會是附圖這樣
想請問各位除了使用等分然後逐段修剪的方式,是不是有其他的方式可以使用呢〔問題〕交通標線 S_180710
Lasoireearx
Lasoireearx
一般會員
一般會員

文章總數 : 15
年齡 : 33
來自 : 苗栗
職業 : 工程顧問公司助理
愛好 : 提琴
個性 : 外向
使用年資 : 新手初學
使用版本 : 2020
經驗值 : 1359
威望值 : 0
注冊日期 : 2021-01-17
男 摩羯座 馬

回頂端 向下

〔問題〕交通標線 Empty 先看看大概是不是這樣畫

發表 由 shackle_2005 周一 16 8月 2021 - 17:33


Option Explicit

Public tm As AcadModelSpace ' 設 tm 簡化名稱圖紙空間
Public tu As AcadUtility
Public pi As Double

Public Sub markline_drawing()

On Error Resume Next

ThisDrawing.SendCommand "ucs" & vbCr & "w" & vbCr
ThisDrawing.SendCommand "undo" & vbCr & "be" & vbCr
pi = 3.141592 / 180

Set tm = ThisDrawing.ModelSpace: Set tu = ThisDrawing.Utility

Dim origin_p(0 To 2) As Double
Dim p1, p2, p3, p4 As Variant
Dim start_p As Variant
Dim line_obj As AcadLine
Dim lw_pline As AcadLWPolyline
Dim points(0 To 9) As Double
Dim line_p1 As Variant
Dim line_p2 As Variant
Dim markline_length As Double
Dim i_count As Integer
Dim markline_number As Integer
Dim dis As Integer
Dim markline_angle As Single

line_p1 = tu.GetPoint(, "請點選標線起點, ESC 結束 !")

If Err Then Exit Sub

line_p2 = tu.GetPoint(line_p1, "請點選標線終點, ESC 結束 !")

If Err Then Exit Sub

dis = 400 + 600

Set line_obj = tm.AddLine(line_p1, line_p2)

markline_length = Int(line_obj.Length)
markline_number = Int(markline_length / dis)
markline_angle = line_obj.Angle

'MsgBox markline_length & Space(3) & markline_number

For i_count = 1 To markline_number

start_p = tu.PolarPoint(line_p1, markline_angle, (i_count - 1) * dis)

p1 = tu.PolarPoint(start_p, markline_angle + 90 * pi, 10)
p2 = tu.PolarPoint(p1, markline_angle + 0, 400)
p3 = tu.PolarPoint(p2, markline_angle + 270 * pi, 20)
p4 = tu.PolarPoint(p3, markline_angle + 180 * pi, 400)

' Define the 2D polyline points
points(0) = start_p(0): points(1) = start_p(1)
points(2) = p1(0): points(3) = p1(1)
points(4) = p2(0): points(5) = p2(1)
points(6) = p3(0): points(7) = p3(1)
points(8) = p4(0): points(9) = p4(1)

Set lw_pline = tm.AddLightWeightPolyline(points): lw_pline.Closed = True: lw_pline.Color = 2: lw_pline.Update

Next i_count

ThisDrawing.SendCommand "undo" & vbCr & "e" & vbCr

End Sub
附件
〔問題〕交通標線 Attachment
markline_drawing.zip 您無權下載這里的附件。(9 Kb) 下載 4 次

____________________________________________________________________________________
〔問題〕交通標線 Ioaoe110 〔問題〕交通標線 Zuoiy_10 〔問題〕交通標線 2020-211 〔問題〕交通標線 Aizyao11 〔問題〕交通標線 Iyb_1510
〔問題〕交通標線 Aizyao10 〔問題〕交通標線 BPl3tjj.png 〔問題〕交通標線 Ziao1510 〔問題〕交通標線 Oo-2-110 〔問題〕交通標線 Oooa_110
shackle_2005
shackle_2005
初級會員
初級會員

文章總數 : 232
年齡 : 52
來自 : 台中
職業 : 程式設計
愛好 : 音樂
個性 : 隨和
使用年資 : 10 年
使用版本 : 2013
積分 : 3
經驗值 : 6640
威望值 : 361
注冊日期 : 2010-09-20
男 獅子座 豬

回頂端 向下

〔問題〕交通標線 Empty 回復: 〔問題〕交通標線

發表 由 Lasoireearx 周三 18 8月 2021 - 11:24

感謝您的幫助,但我不太明白這個要怎麼使用跟設定
Lasoireearx
Lasoireearx
一般會員
一般會員

文章總數 : 15
年齡 : 33
來自 : 苗栗
職業 : 工程顧問公司助理
愛好 : 提琴
個性 : 外向
使用年資 : 新手初學
使用版本 : 2020
經驗值 : 1359
威望值 : 0
注冊日期 : 2021-01-17
男 摩羯座 馬

回頂端 向下

〔問題〕交通標線 Empty 回復: 〔問題〕交通標線

發表 由 naruto018 周三 18 8月 2021 - 16:46

基本方式可以使用COPY(複製)的陣列或直接用陣列(arrayrect)就可以達成
〔問題〕交通標線 TJsDRdR
naruto018
naruto018
中級會員
中級會員

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

HEMOS likes this post

回頂端 向下

〔問題〕交通標線 Empty 回復: 〔問題〕交通標線

發表 由 Lasoireearx 周五 3 9月 2021 - 12:07

主要是在彎道的時候會有些問題,我目前正在思考要怎麼做
Lasoireearx
Lasoireearx
一般會員
一般會員

文章總數 : 15
年齡 : 33
來自 : 苗栗
職業 : 工程顧問公司助理
愛好 : 提琴
個性 : 外向
使用年資 : 新手初學
使用版本 : 2020
經驗值 : 1359
威望值 : 0
注冊日期 : 2021-01-17
男 摩羯座 馬

回頂端 向下

〔問題〕交通標線 Empty 回復: 〔問題〕交通標線

發表 由 shackle_2005 周五 3 9月 2021 - 16:19

可以上傳彎道的簡單 sample 嗎 ?? 我想想辦法

____________________________________________________________________________________
〔問題〕交通標線 Ioaoe110 〔問題〕交通標線 Zuoiy_10 〔問題〕交通標線 2020-211 〔問題〕交通標線 Aizyao11 〔問題〕交通標線 Iyb_1510
〔問題〕交通標線 Aizyao10 〔問題〕交通標線 BPl3tjj.png 〔問題〕交通標線 Ziao1510 〔問題〕交通標線 Oo-2-110 〔問題〕交通標線 Oooa_110
shackle_2005
shackle_2005
初級會員
初級會員

文章總數 : 232
年齡 : 52
來自 : 台中
職業 : 程式設計
愛好 : 音樂
個性 : 隨和
使用年資 : 10 年
使用版本 : 2013
積分 : 3
經驗值 : 6640
威望值 : 361
注冊日期 : 2010-09-20
男 獅子座 豬

回頂端 向下

回頂端


 
這個論壇的權限:
無法 在這個版面回復文章
〔問題〕交通標線 Aoe1-113〔問題〕交通標線 Ioaoe110〔問題〕交通標線 2020-310〔問題〕交通標線 Oiu15010〔問題〕交通標線 2020-211〔問題〕交通標線 Ia15010〔問題〕交通標線 Aizyao10〔問題〕交通標線 Uos15010〔問題〕交通標線 BPl3tjj〔問題〕交通標線 Ziao1510
〔問題〕交通標線 Aoe15010〔問題〕交通標線 Oo-2-110〔問題〕交通標線 Zuoiy_10〔問題〕交通標線 Aizyao11〔問題〕交通標線 Iyb_1510〔問題〕交通標線 Aoe1-112〔問題〕交通標線 Uos15011〔問題〕交通標線 Aoe2da10〔問題〕交通標線 Aoe2da11〔問題〕交通標線 Aoe10