模具论坛

 找回密码
 注册

扫一扫,微信登录

QQ登录

只需一步,快速开始

搜索
热搜: 冲压 注塑 求助
    回车查看更多
    论坛可能已存在您要发布的主题帖 关闭
      查看: 2779|回复: 0

      [原创] SOLT.LSP

      [复制链接]
      发表于 2008-5-8 22:00:36 | 显示全部楼层 |阅读模式
      (defun C:SLOT () ; V1.00
         ;

         ; Draws a long slot with rounded ends by specifying center point,
         ; width, overall length, and angle of slot.
         ;                  

        (setq c1 (getpoint "Enter CENTER POINT of SLOT:  ")
              sw (getdist c1 "\nEnter WIDTH of SLOT:  ")
              sl (getdist c1 "\nEnter LENGTH of SLOT:  ")
              phi (getangle c1 "\nEnter ANGLE of SLOT: ")
              dW (mapcar '- (polar c1 (+ phi (/ pi 2)) (/ sw 2)) c1) ;1/2 width vector
              dL (mapcar '- (polar c1 phi (/ (- sl sw) 2)) c1)       ;1/2 length vector
              v1 (mapcar '+ dL (mapcar '* '(-1 -1) dW))      ; vector frm cen to p1
              v3 (mapcar '+ dW dL)                           ; vector frm cen to p3
              p1 (mapcar '+ c1 v1)
              p2 (polar c1 phi (/ sl 2))
              p3 (mapcar '+ c1 v3)
              p4 (mapcar '- c1 v1)
              p5 (polar c1 phi (/ sl -2))
              p6 (mapcar '- c1 v3)
        )
        (setvar "cmdecho" 0)
        (setq tmp (getvar "pdmode"))
        (setvar "pdmode" 0)
        (command "point" c1)
        (command "pline" p6 p1 "A" p3 "L" p4 "A" "CL")
        (setvar "pdmode" tmp)
      (princ)
      (princ)
      )
      (prompt "\nType SLOT to envoke the command")
      您需要登录后才可以回帖 登录 | 注册

      本版积分规则

      关闭

      招聘信息 上一条 /5 下一条

      关闭

      求职信息 上一条 /5 下一条

      关闭

      技术求助 上一条 /5 下一条

      QQ|小黑屋|手机版|模具论坛 ( 浙ICP备15037217号 )

      GMT+8, 2025-5-26 00:00

      Powered by Discuz! X3.4

      © 2001-2013 Comsenz Inc.

      快速回复
      返回顶部
      返回列表
       
      客服电话:0577-61318188
      模具论坛交流群:
      模具论坛交流群
      工作时间:
      08:30-17:30