乐筑天下

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

[编程交流] angtos function: from 101°2�

[复制链接]

1

主题

3

帖子

2

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-5 23:24:07 | 显示全部楼层 |阅读模式
Does anyone have an idea how to add a zero to a single digit min or second return?
 
Like my title said i get 101°2'4" and need 101°02'04"
 
Any clue is welcome :-)
回复

使用道具 举报

26

主题

1495

帖子

20

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
118
发表于 2022-7-5 23:41:59 | 显示全部楼层
Look into DIMZIN sysvar  There is a setting that drops the leading zeros  Maybe  Maybe not  
-David
回复

使用道具 举报

1

主题

3

帖子

2

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-5 23:52:22 | 显示全部楼层
Thanks for your help but it look like DimZin is only about suppressing not adding zero.. Unless i missed something..
回复

使用道具 举报

26

主题

1495

帖子

20

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
118
发表于 2022-7-6 00:03:29 | 显示全部楼层
What is your current DIMZIN setting ?
回复

使用道具 举报

1

主题

3

帖子

2

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-6 00:05:23 | 显示全部楼层
 
 
it's currently set to zero
回复

使用道具 举报

8

主题

1133

帖子

1164

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-6 00:21:12 | 显示全部楼层
I am not sure that you can get a display as you want. AutoCAD writers do not appear to have any surveying knowledge, but merely mathematical know-how where leading zeroes for degrees, minutes and seconds are not important  
 
Maybe you will have to do it manually, unless some kind lisp guru can provide the necessary.
回复

使用道具 举报

24

主题

135

帖子

111

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
120
发表于 2022-7-6 00:30:45 | 显示全部楼层
Hi Dan46
Try this function from ymg.
  1. ; angtodms       by ymg                                                       ;; Given an angle in radian and number of decimal after the seconds            ;; Returns a string formatted in Degree Minutes and Seconds,                   ;; with proper symblol for degree and leading 0 on the minutes and seconds     ;;           0°00'00.0"    271°05'06.3" etc.                                   ;(defun angtodms (a prec /)    (setq a (angtos a 1 (+ prec 4)))    (while (<  (vl-string-position (ascii "d") a) 3)                   (setq a (strcat " " a))    )    (if (< (vl-string-position (ascii "'") a) 6) (setq a (strcat (substr a 1 4) "0" (substr a 5)))    )    (if (< (vl-string-position (ascii """) a) (+ 9 (if (= 0 prec) 0 (1+ prec)))) (setq a (strcat (substr a 1 7) "0" (substr a ))    )    (vl-string-subst  "°" "d" a) )
 
Thank you ymg
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-11 00:33 , Processed in 0.352532 second(s), 66 queries .

© 2020-2025 乐筑天下

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