乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 85|回复: 9

[编程交流] 角度、距离Lisp例程

[复制链接]

2

主题

5

帖子

3

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-6 07:28:45 | 显示全部楼层 |阅读模式
大家好,
 
我知道有一个角度/距离lsp例程,因为我在过去的工作中使用过它。有人知道这个网站上有没有贴?
 
这是一个简单的惯例。拾取终点,选择后座点,输入角度,输入距离,等等。
 
Lsp也可以称为连续遍历??
 
谢谢
回复

使用道具 举报

29

主题

519

帖子

477

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
163
发表于 2022-7-6 07:40:19 | 显示全部楼层
看看李的网站,他有很多很棒的LISP例程。
 
链接:http://lee-mac.com/
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 2022-7-6 07:42:26 | 显示全部楼层
自2006年6月2日起:
 
回复

使用道具 举报

2

主题

5

帖子

3

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-6 07:52:45 | 显示全部楼层
嗨,小家伙,在网站上找不到。
 
RenderMan,我用过@100
 
我需要从这条线的终点开始我的遍历,回到我设置的那条线上,这将把角度设置为“0”。然后我可以在354.65的距离处输入95d03'45英寸的角度。
 
我应该从我以前的工作中去掉Lisp程序!
回复

使用道具 举报

63

主题

6297

帖子

6283

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
358
发表于 2022-7-6 08:00:32 | 显示全部楼层
像这样的事情?
 
如果没有,就用更多的细节来阐明你的目标。
 
  1. (defun c:Test (/ p)
  2. ;;; Tharwat 28. Sep. 2012 ;;;
  3. (if (and (setq p (getpoint "\n Specify start point of line :"))
  4.           (setq a (cond ((getangle (strcat "\n Specify Angle in Degree "
  5.                                            (if a
  6.                                              (strcat "< " (rtos a 2) " >")
  7.                                              ""
  8.                                            )
  9.                                            ":"
  10.                                    )
  11.                          )
  12.                         )
  13.                         (t
  14.                          (if a
  15.                            a
  16.                            nil
  17.                          )
  18.                         )
  19.                   )
  20.           )
  21.           (setq d (cond ((getdist (strcat "\n Specify Distance "
  22.                                           (if d
  23.                                             (strcat "< " (rtos d 2) " >")
  24.                                             ""
  25.                                           )
  26.                                           ":"
  27.                                   )
  28.                          )
  29.                         )
  30.                         (t
  31.                          (if d
  32.                            d
  33.                            nil
  34.                          )
  35.                         )
  36.                   )
  37.           )
  38.      )
  39.    (entmake (list '(0 . "LINE")
  40.                   (cons 10 (trans p 0 1))
  41.                   (cons 11 (polar p a d))
  42.             )
  43.    )
  44.    (princ)
  45. )
  46. (princ)
  47. )
回复

使用道具 举报

17

主题

193

帖子

179

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
84
发表于 2022-7-6 08:07:21 | 显示全部楼层
 
 
试试这个,我从某个我不记得的地方得到的:
 
  1. ;Tip1741:  BD.LSP           Bearing/Distance lines         (c)2001, Joon Hong  $50 Bonus Winner
  2. (defun C:BD  ()
  3. (setvar "cmdecho" 0)
  4. (initget 1)
  5. (setq PT (getpoint "\nPick a starting point: "))
  6. (initget 1 "NE NW SE SW")
  7. (setq BR (getkword "\nPick bearing (NE/NW/SE/SW): "))
  8. (setq OPT (strcase BR))
  9. (initget 1)
  10. (setq LEN (getreal "\nType the length: "))
  11. (setq DEG (getstring "\nType the degree: ")
  12.        minx (getstring "\nType the minute: ")
  13.        SEC (getstring "\nType the second: "))
  14. (if (= DEG "")
  15.    (setq DEG "0"))
  16. (if (= minx "")
  17.    (setq minx "0"))
  18. (if (= SEC "")
  19.    (setq SEC "0"))
  20. (cond ((= "SW" OPT)
  21.         (setvar "angbase" (cvunit 270 "degree" "radian"))
  22.         (setvar "angdir" 1))
  23.        ((= "SE" OPT)
  24.         (setvar "angbase" (cvunit 270 "degree" "radian"))
  25.         (setvar "angdir" 0))
  26.        ((= "NW" OPT)
  27.         (setvar "angbase" (cvunit 90 "degree" "radian"))
  28.         (setvar "angdir" 0))
  29.        ((= "NE" OPT)
  30.         (setvar "angbase" (cvunit 90 "degree" "radian"))
  31.         (setvar "angdir" 1)))
  32. (command "line" PT (strcat "@" (rtos LEN) "<" DEG "d" minx "'" SEC """) "")
  33. (setvar "angbase" 0)
  34. (setvar "angdir" 0)
  35. (setvar "cmdecho" 1)
  36. (princ))
  37. (princ "\nType 'BD' to draw lines with bearings")
  38. (princ)

 
第二部分在新线的起点和终点附近拾取线。这将返回现有角度,然后可以输入摆动角度,该角度添加到现有线角度,极轴将给出新的pt,依此类推。您可以选择“拾取起始线或新pt拾取空白屏幕”或按enter键,然后在输入真实方位的情况下询问拾取起始点。您可能还需要输入后方位,这取决于您输入的BRG。
回复

使用道具 举报

8

主题

1133

帖子

1164

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-6 08:12:57 | 显示全部楼层
回复

使用道具 举报

35

主题

2471

帖子

2447

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
174
发表于 2022-7-6 08:16:34 | 显示全部楼层
I believe that as long the current UCS is aligned with the base line, there is nothing to prevent the usage of relative coordinates; for sure, the units for angles had to be set accordingly, too.
Please check the Object option of UCS command - select the base line close to the end where you want the origin of your custom coordinates system.
回复

使用道具 举报

35

主题

2471

帖子

2447

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
174
发表于 2022-7-6 08:26:14 | 显示全部楼层
Alternatively, if you had enabled the Polar Tracking feature, there is the option to provide the polar angle as absolute value or relative to the last segment.
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-6 08:31:46 | 显示全部楼层
My 5 cents worth first nod684
 
  1. Its easier to do ddd.mmss and convert only need 1 getreal.(setq DEG (getstring "\nType the degree: ")       minx (getstring "\nType the minute: ")       SEC (getstring "\nType the second: "))(setq DEGbrg  (getreal "\nType the degree DDD.MMSS : ")(setq DEG = You take the DEGbrg fix, subtract *100 fix subtract divide 60 subtract divide 3600 so end up with decimal angle. Just need your units variables set correct. ) No cad at moment.
 
2nd part pick line near start end of new line this returns exist angle then you can enter swing angle which is added to existing line angle and a polar gives new pt and so on. You would have an option like "pick start line or new pt   pick blank screen or press enter so then asks pick start point with true bearings entered.  You may need a back bearing entered as well depends what BRG's you are entering.
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-10 04:56 , Processed in 0.349585 second(s), 72 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表