乐筑天下

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

[编程交流] LISP worked in 2012, but not f

[复制链接]

1

主题

2

帖子

1

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-5 23:05:48 | 显示全部楼层 |阅读模式
Hopefully someone can help me.  The LISP in question was already created when I started at my company 8 years and I have no idea how to read/create them.  Of course that person is no longer here and nobody else has any knowledge of LISPs.
 
It allows you to measure a distance using multiple points, rounds the value up to the nearest 10, inserts a specific block and enters the measurement into the attribute field. In 2012 and all the way back to 2007 it worked as it is supposed to.  It works as it always has until the end, in 2014 it brings up the 'enter attributes' window.  I have attached our block we use and the LISP is below.
 
Thank you for any help anyone can provide.
 
Victor
 
  1. (defun c:WW () (setq   PT01    (getpoint "\Start Point: ")   CALC01  0   SCALE01 (getvar "dimscale") ) (while   (setq PT02 (getpoint PT01 "\nNext Point:  "))    (if PT02      (setq DIST01 (distance PT01 PT02)     CALC02 (+ DIST01 CALC01)     CALC01 CALC02     PT01   PT02     CALC03 (* 10 (+ 1 (fix (/ (fix CALC01) 10))))      )    ) ) (setq PT03 (getpoint "\nInsertion Point ")) (if PT03   (command "insert" "Block-Ftg-WW.dwg" PT03 SCALE01 SCALE01 pause CALC03) ) (setq CALC03 0) (princ "\n   WW FOOTAGE COMPLETE  ") (princ))
Block-Ftg-WW.dwg
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-5 23:19:03 | 显示全部楼层
Its probably the "insert" like this it will pop the dialouge box try the "_insert" I think Lee-mac on his web site has description about ._command _command etc.
回复

使用道具 举报

2

主题

20

帖子

18

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-5 23:25:13 | 显示全部楼层
I had the same issue with one of my lisps.
Set ATTDIA system variable to 0
回复

使用道具 举报

63

主题

6297

帖子

6283

银币

后起之秀

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

铜币
358
发表于 2022-7-5 23:37:47 | 显示全部楼层
This ... ?
 
  1. (defun c:test (/ *error* d p 1p s f v) ;;    Tharwat 06.May.2014        ;; (defun *error* (x)   (if v     (mapcar 'setvar '(attreq attdia) v)   )   (princ) ) (cond ((and (not (tblsearch "BLOCK" (setq f "Block-Ftg-WW"))) (not (setq f (findfile "Block-Ftg-WW.dwg"))))        (alert "Can not find Drawing < Block-Ftg-WW.dwg > !!")       )       ((setq d 0.              p (getpoint "\n Specify Point: ")        )       ) ) (if p   (while (setq 1p (getpoint p "\n Next Point :"))     (setq d (+ d (distance p 1p))           p 1p     )   ) ) (if (and d (setq p (getpoint "\n Insertion Point ")))   (progn (setq v (mapcar 'getvar '(attreq attdia)))          (mapcar 'setvar '(attreq attdia) '(1 0))          (command "_.-insert"                   f                   "_none"                   p                   (setq s (getvar 'DIMSCALE))                   s                   pause                   (rtos (* 10 (+ 1 (fix (/ (fix d) 10)))) 2)          )    ) ) (*error* nil) (princ))
回复

使用道具 举报

1

主题

2

帖子

1

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-5 23:44:32 | 显示全部楼层
meracl - That was the ticket.  Thank you very much.  That saved us a lot of headaches.
 
Tharwat and BIGAL - Thank you for your help too.
回复

使用道具 举报

63

主题

6297

帖子

6283

银币

后起之秀

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

铜币
358
发表于 2022-7-5 23:51:23 | 显示全部楼层
You're welcome .
 
And hope the routine running as needed .
回复

使用道具 举报

4

主题

2143

帖子

2197

银币

限制会员

铜币
-24
发表于 2022-7-6 00:02:42 | 显示全部楼层
Please read the Code Posting Guidelines and use Code Tags for your Code. I fixed your original post for you this time.
回复

使用道具 举报

2

主题

20

帖子

18

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-6 00:06:35 | 显示全部楼层
You are welcome.
Im glad that, solved your problem.
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-11 03:17 , Processed in 0.439246 second(s), 68 queries .

© 2020-2025 乐筑天下

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