乐筑天下

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

[编程交流] Left Right Up & Down

[复制链接]

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-5 18:13:36 | 显示全部楼层 |阅读模式
Often I just need to draw a simple ortho shape so I press F8 drag mouse type distance etc etc fall over fingers in process. So why not just up left down right close. So maybe its useful maybe not but I have posted it here. Just type direction LRDU or lrdu plus the distance. It could add say 45's also using other alpha characters.
 
  1. ; draw a pline by direction Up Down left or Right use upper or lowercase; by Alan H dec 2015; this version is a metric/decimal version; version 2 depending on requests will be a imperial version; 1'8 1/4" input d1.8.25 start with 1.8 = 1'8" then add second fraction ver 3; how to use u123.45; L34.57 ; d102.6 ; r53 ; C or  to leave open; as many entries as you like(defun ah:left ( / pt2)(setq pt2 (polar pt pi (atof (substr ans 2 (- (strlen ans) 1)))))(setq pt pt2)(command pt2))(defun ah:up ( / pt2)(setq pt2 (polar pt (/ pi 2.0) (atof (substr ans 2 (- (strlen ans) 1)))))(setq pt pt2)(command pt2))(defun ah:right ( / pt2)(setq pt2 (polar pt 0.0 (atof (substr ans 2 (- (strlen ans) 1)))))(setq pt pt2)(command pt2))(defun ah:down ( / pt2)(setq pt2 (polar pt (* 1.5 pi) (atof (substr ans 2 (- (strlen ans) 1)))))(setq pt pt2)(command pt2))(defun C:LUDR ( / pt ans)(command "_pline")(command (setq pt (getpoint "Pick start point - Enter or C to finish")))(while (= (getvar "cmdactive") 1 ) (setq ans (getstring "Enter L123 U456 R67 D78"))(cond ((= ans "")(command ""))     ((= "L"(strcase (substr ans 1 1)))(ah:left))     ((= "U"(strcase (substr ans 1 1)))(ah:up))     ((= "D"(strcase (substr ans 1 1)))(ah:down))     ((= "R"(strcase (substr ans 1 1)))(ah:right))     ((= "C"(strcase (substr ans 1 1)))(command "close"))) ;cond) ; while)
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-12 20:21 , Processed in 0.734859 second(s), 54 queries .

© 2020-2025 乐筑天下

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