乐筑天下

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

[编程交流] 帮助距离和方位lisp

[复制链接]

24

主题

135

帖子

111

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
120
发表于 2022-7-5 17:33:22 | 显示全部楼层
 
没有什么可以回答我的问题,它只是建议用123.4557代替原来的123.45'57“格式。正如你所看到的,我们可以用前者来绘制线条。
 
我想到时候你得给我解释一下
 
 
这可以安排,但你需要告诉我,如果你想坚持原来的格式为方位提示或使用双精度的建议
回复

使用道具 举报

pBe

32

主题

2722

帖子

2666

银币

后起之秀

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

铜币
211
发表于 2022-7-5 17:34:00 | 显示全部楼层
 
如果我不使用lisp绘图。
 
例如
  1. (Defun c:demo (/ file opfile a ptlst sp p_ ang ro ptlst pts)
  2. (setq file (Getfiled "Boundary Data" (getvar 'DWgprefix) "txt" 33))
  3. (startapp "Notepad" file)
  4. (setq pts    nil
  5.        ptlst  nil
  6.        opfile (open file "r")
  7. )
  8. (While (setq a (read-line opfile))
  9.    (setq ptlst (append ptlst (list (strcase a))))
  10. )
  11. (close opfile)
  12. (if (and ptlst
  13.           (setq sp (getpoint "\nPick Start point:"))
  14.           (setq pts (append pts (list sp)))
  15.           (setq txht (getreal "\nEnter Text height:"))
  16.      )
  17.    (progn
  18.      (command "_pline" sp)
  19.      (foreach itm ptlst
  20.        (command "_non" itm)
  21.        (setq pts (append pts (list (getvar 'Lastpoint))))
  22.      )
  23.      (command "")
  24.      (mapcar '(lambda (j k l)
  25.                 (setq str (substr (vl-string-subst " - Az " "<" l) 2)
  26.                       str (vl-string-subst "%%d" "D" str)
  27.                 )
  28.                 (setq txtD (entmakex
  29.                   (list (cons 0 "TEXT")
  30.                         (cons 10
  31.                               (Setq p_
  32.                                      (polar j (setq ang (angle j k)) (* 0.5 (distance j k)))
  33.                               )
  34.                         )
  35.                         (cons 11 (polar p_ (+ ang (* pi 1.5)) txht))
  36.                         (cons 40 txht)
  37.                         (Cons 50 (if (setq ro (<  (/ pi 2.0)  ang (* pi 1.5))) (+ ang pi) ang))
  38.                         '(72 . 4)
  39.                         '(73 . 3)
  40.                         (cons 1 (if ro (strcat "<< "str)(strcat str " >>")))
  41.                   )
  42.                 )
  43.                       )
  44.                
  45.               )
  46.              pts
  47.              (cdr pts)
  48.              ptlst
  49.      )
  50.    )
  51. )(princ)
  52. )
回复

使用道具 举报

24

主题

135

帖子

111

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
120
发表于 2022-7-5 17:38:21 | 显示全部楼层
 
我得到了Madruga_SP的那部分。
 
 
这是我很难理解的部分。
输入@500方位角等于123.4557和距离500有那么难吗?如果唯一的问题是“d”和引号符号,那么可以用123-45-57提示您,这里的问题如第14篇文章所示,是分钟和秒之间的区别。一个在哪里结束,另一个在哪里开始?
45.233-->23英尺3英寸或2英尺33英寸?
 
此外,似乎您希望“看到”屏幕上绘制的线条,与我向您建议和证明的相反,输入所有值,然后一次性绘制多段线[很像alanjt的代码,可以修改,其中会提示您输入,然后绘制多段线]。
 
我认为真正的问题是通过避免其他符号来轻松键入值。现在,如果你或比加尔能够阐明分秒的问题,那么,如果应该是轻松无礼的日本人。
 
对不起,我理解力差
回复

使用道具 举报

pBe

32

主题

2722

帖子

2666

银币

后起之秀

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

铜币
211
发表于 2022-7-5 17:41:43 | 显示全部楼层
 
当你使用这个输入角度的系统时,你要非常小心地始终使用两位数表示分和秒。
 
所以45d3'5“将变成45.0305
 
有些人坚持用3位数字来表示度数,如果必要的话,可以加上前导零。
回复

使用道具 举报

24

主题

135

帖子

111

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
120
发表于 2022-7-5 17:44:24 | 显示全部楼层
回复

使用道具 举报

pBe

32

主题

2722

帖子

2666

银币

后起之秀

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

铜币
211
发表于 2022-7-5 17:46:05 | 显示全部楼层
 
There's nothing there that answers my Q, It only suggest instead of the original format of  123.45'57" use 123.4557. As you can see we were able to use the former to plot the lines.
 
I guess you're going to have to explain it to me then  
 
 
That can be arrange, but you need to tell me if you want to stick with the original format for azimuth prompt or use Bigals suggestion
回复

使用道具 举报

24

主题

135

帖子

111

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
120
发表于 2022-7-5 17:49:27 | 显示全部楼层
 
If I were to draw without using lisp.
 
e.g

[code]Command: plPLINESpecify start point:Specify next point or [Arc/Halfwidth/Length/Undo/Width]:   @500
回复

使用道具 举报

54

主题

3755

帖子

3583

银币

后起之秀

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

铜币
438
发表于 2022-7-5 17:52:43 | 显示全部楼层
  1. (defun c:Test (/ p) (if (setq p (getpoint "\nSpecify SE corner of square: "))   (entmakex     (append (list '(0 . "LWPOLYLINE")                   '(100 . "AcDbEntity")                   '(100 . "AcDbPolyline")                   '(90 . 4)                   '(70 . 1)                   (cons 10 (setq p (trans p 1 0)))             )             (mapcar (function (lambda (x) (cons 10 (mapcar '+ p x))))                     '((-500. 0. 0.) (-500. 500. 0.) (0. 500. 0.))             )     )   ) ) (princ))
回复

使用道具 举报

pBe

32

主题

2722

帖子

2666

银币

后起之秀

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

铜币
211
发表于 2022-7-5 17:57:53 | 显示全部楼层
 
I got that part  Madruga_SP.
 
 
This is the part i'm having trouble understanding.
Is it that hard to type in @500 an azimuth equivalent 123.4557 and distance 500?  if the only issue the "d" and quote symbols then you can be prompted with 123-45-57, the issue here as shown on post # 14 is the distinction between minutes and seconds. where does one end and the other start?
45.233 ----> 23'3" or 2'33"?
 
Also it appears that you want to "see" the lines  being drawn on the screen as oppose to what i suggested and proven to you, input all the values then draw the polyline in one go [much like alanjt's code, can be modified wherein you'll  prompted for input THEN draw the polyline].
 
The real issue here me thinks is the ease of typing in the value by avoiding the other symbols. Now if you or Bigal can shed light on the minutes and seconds issue then if should be easy cheesy japanesey.
 
sorry for my poor understanding
回复

使用道具 举报

8

主题

1133

帖子

1164

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-5 18:00:14 | 显示全部楼层
 
When you use this system of entering angles, you are very careful to always use two digits for both the minutes and seconds.
 
So 45d3'5" would become 45.0305
 
There are some who insist on having 3 digits for the degrees, and put leading zeroes if necessary.
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-13 13:11 , Processed in 0.611768 second(s), 81 queries .

© 2020-2025 乐筑天下

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