Sideshow-Cad 发表于 2022-7-5 18:24:43

最大停车视距

大家好,
 
我想沿路线多个间隔测量从车道1号车道(第1条车道)到中央预留护栏(第2条车道)的最大停车视距。
 
我正在寻找一个lisp命令,该命令以指定的间隔从pline1绘制多条直线,在它们接触pline 2之前,以其最大长度绘制。这两条线可能并不完全平行。
 
有人能帮我吗?
 
提前谢谢。

Tharwat 发表于 2022-7-5 18:32:30

欢迎来到论坛。
 
你知道命令划分吗?
 
你能提供更多细节吗?

Sideshow-Cad 发表于 2022-7-5 18:45:52

我知道divide可以用来沿多段线绘制点或块。但是我想在沿着第1条多边形线的某些间隔接触第2条多边形线之前,从一条多边形线以其最大长度绘制直线。
 
E、 g想象你正沿着保利1号线开车。在沿途的中央保留区(折线2)中有一个混凝土屏障。我想绘制您的视力从您的汽车(折线1)到您可以看到前方多远,然后中央保留区(折线2)挡住您的视线。我想在整个路线上每隔一段时间这样做。
 
谢谢
 
对不起,我解释得不好。

Tharwat 发表于 2022-7-5 18:53:11

如果你能把你的话写进一张有前后对比的图画中,那就更清楚了

Sideshow-Cad 发表于 2022-7-5 19:01:47

随附示例。
 
我想每隔一段特定的时间沿着整条路线重复“停车视线”。
 
请注意,在接触多段线2之前,这些线是如何达到其最大长度的
例如图纸

BIGAL 发表于 2022-7-5 19:05:24

你想要像我的“车道”一样的东西,它在进入一处房产时检查汽车是否触底,但从平面图来看,视距要复杂一些。如果你把3d技术引入其中,会更加复杂。像Autoturn这样的产品内置了此功能。
 

 
欢迎您更改此代码。它需要两件事来更改。距离2.8是车轮中心之间的距离,因此这将需要是您的停车视距值,并且可以用一条线替换块,您只需手动查看它是否存在冲突。下面的代码是VBA,我一直想在Vlisp中重做。
 

Sub draw_vehicle()

Dim CAR As String
Dim arcobj As AcadArc
Dim oPoly As AcadEntity
Dim blkobj As AcadEntity
Dim retVal As Variant
Dim snapPt As Variant
Dim oCoords As Variant
Dim blpnt1() As Variant
ReDim blpnt1(100)
Dim blpnt2() As Variant
ReDim blpnt2(100)
Dim vertPt(0 To 2) As Double
Dim Pt1(0 To 2) As Double
Dim Pt2(0 To 2) As Double
Dim newPt(0 To 2) As Double
Dim iCnt, w, x, y, z As Integer
Dim cRad, interval, blkangle As Double
Dim circObj As AcadCircle
Dim lineObj As AcadLine

On Error GoTo Something_Wrong

If ThisDrawing.ActiveSpace = acModelSpace Then
Set Thisspace = ThisDrawing.ModelSpace
Else: Set Thisspace = ThisDrawing.PaperSpace
End If

For Each Item In ThisDrawing.Blocks
If Item.Name = "holden" Then GoTo continue_on

Next Item
' insert holden block
InsertBlock "p:\Autodesk\vba\holdencar.dwg", 0

continue_on:

w = 1

ThisDrawing.Utility.GetEntity oPoly, snapPt, vbCr & "Select polyline :"
If oPoly.ObjectName = "AcDbPolyline" Then
oCoords = oPoly.Coordinates
Else: MsgBox "This object is not a polyline! Please do again"
Exit Sub
End If

interval = CDbl(InputBox("Enter interval:", , 1#))
If interval < 1 Then
interval = 1
End If

For iCnt = 0 To UBound(oCoords) - 2 Step 2
Pt1(0) = oCoords(iCnt): Pt1(1) = oCoords(iCnt + 1): Pt1(2) = 0#

newPt(0) = Pt1(0)
newPt(1) = Pt1(1)
newPt(2) = 0#

iCnt = iCnt + 2

Pt2(0) = oCoords(iCnt): Pt2(1) = oCoords(iCnt + 1): Pt2(2) = 0#

x = (Pt1(0) - Pt2(0)) / interval
y = (Pt1(1) - Pt2(1)) / interval

'reset back 2 values

iCnt = iCnt - 2
cRad = 3.05
startang = 4.71239

endang = 1.570796

CAR = "HOLDEN"

For z = 1 To interval
vertPt(0) = newPt(0) - x
vertPt(1) = newPt(1) - y
vertPt(2) = 0#
'blpnt1(w) = vertPt
'Set arcobj = ThisDrawing.ModelSpace.AddArc(vertPt, cRad, endang, startang)
Set arcobj = Thisspace.AddArc(vertPt, cRad, endang, startang)
retval2 = arcobj.IntersectWith(oPoly, acExtendOtherEntity)
arcobj.Delete
Set arcobj = Nothing

blkangle = ThisDrawing.Utility.AngleFromXAxis(retval2, vertPt)

'Set blkobj = ThisDrawing.ModelSpace.InsertBlock(vertPt, CAR, 1#, 1#, 1#, blkangle)
Set blkobj = Thisspace.InsertBlock(vertPt, CAR, 1#, 1#, 1#, blkangle)

Set blkobj = Nothing

w = w + 1

newPt(0) = newPt(0) - x
newPt(1) = newPt(1) - y

Next z

Next iCnt
GoTo Exit_out

Something_Wrong:
MsgBox Err.Description

Exit_out:

End Sub

Private Sub InsertBlock1()




   InsertBlock "p:\Autodesk\vbaholden.dwg", 0

   'Change the 0 to another value (in degrees) to rotate the block'



   End Sub

   Function InsertBlock(ByVal blockpath As String, ByVal rotation As Double)

   Dim blockobj As AcadBlockReference

   Dim insertionPnt As Variant

   Dim prompt1 As String

   'set rotation Angle

   rotateAngle = rotation

   'rotateAngle = rotation * 3.141592 / 180#

   'Prompt is used to show instructions in the command bar

   prompt1 = vbCrLf & "Enter block insert point: "

   'ThisDrawing.ActiveSpace = acModelSpace

   insertionPnt = ThisDrawing.Utility.GetPoint(, prompt1)

   Set blockRefObj = ThisDrawing.ModelSpace.InsertBlock(insertionPnt, blockpath, 1#, 1#, 1#, rotateAngle)

   'Change Modelspace into Paperspace to insert the block into Paperspace

   End Function


 

Sideshow-Cad 发表于 2022-7-5 19:14:54

 
任何人都可以编辑以上^^^或以下内容:(以帮助我达到我想要的输出?)
 
(定义c:pso(/cl1 cl2 d pt pt2 templine ang spc)
;;;pBe 2014年8月30日;;;
(如果(和
(原则“\n选择主路线”)
(setq cl1(ssget“_:S”'((0。“*多段线”)))
(原则“\n选择偏移对齐”)
(setq cl2(ssget“_:S”'((0。“*多段线”)))
)
(程序
(setq d(cond((getdist
(strcat“\n输入增量值:”
(cond(d_)(100.00))
) 2 2) ">: ")))
(d)
)
)
(setq cl1(ssname cl1 0)
cl2(ssname cl2 0)d\uD)
(while(setq pt(vlax curve getpointatdist cl1 d))
(setq ang(角度)(0.0.0.0)
(vlax曲线getfirstderiv
cl1
(vlax曲线getparamatpoint cl1 pt)
)
)
)
(setq templine(vlax invoke(setq spc)(vlax get
(vla get ActiveLayout
(vla get ActiveDocument(vlax get acad object)))
“Block”)“AddXline pt
(极性pt(setq ang(+ang(*pi 1.5)))1)
)
(如果(setq pt2(vlax调用
坦普林
'与相交
(vlax ename->vla对象cl2)
0
)
)
(vlax invoke spc’Addline pt(list(Car pt2)(cadr pt2)(caddr pt2)))
)
(vla删除模板)
(setq d(+d d_))
)
)
)
(普林斯)
)
(vl load com)
 
 
 
感谢您提前提供的任何帮助

BIGAL 发表于 2022-7-5 19:23:10

看看这个链接http://advancedroaddesign.com.au/一个新版本只需要一周或两周的时间,其中包括停车点距离,检查各种速度的全3d。是主干道还是侧路?转到“更多”按钮。

Organic 发表于 2022-7-5 19:25:54

我个人会手动检查视距。相对于您正在设计的道路工程量而言,这是一项相当容易的任务。
页: [1]
查看完整版本: 最大停车视距