乐筑天下

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

[编程交流] It used to work, but quit

[复制链接]

4

主题

17

帖子

13

银币

初来乍到

Rank: 1

铜币
20
发表于 2022-7-6 10:03:56 | 显示全部楼层
 
I looked up attreq and it has something to do with blocks and prompts that I don't quite understand.
 
1
Turns on prompts or a dialog box for attribute values, as specified by ATTDIA
 
 
As you can tell, I am no programmer of LISP.  I used to do some FORTRAN and once learned ICAD which was an AI language based on lisp.  I am an Engineer that plays with ACAD to produce drawings.
 
I would guess that attreq being off caused the attributed text to be inserted and not the value I wanted to be put in the box or circle.
 
Thanks for all the help.  I will probably be back to ask more dumb lisp questions, so be patient with an old FORTRAN programmer.
回复

使用道具 举报

4

主题

17

帖子

13

银币

初来乍到

Rank: 1

铜币
20
发表于 2022-7-6 10:06:45 | 显示全部楼层
 
I was thinking that it would be nice to combine an alpha character in front of the integer but I'm not sure how to apply strcat.
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 10:12:45 | 显示全部楼层
 
Try something like this:
 
  1. (defun c:mem nil (InsertBlock "memnum" "\nEnter Member Number to start with: "))(defun c:joi nil (InsertBlock "jn"     "\nEnter Joint Number to start with: "))(defun InsertBlock ( block msg / *error* old pre pt scale val var ) (defun *error* ( msg )   (if old (mapcar 'setvar var old))   (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")       (princ (strcat "\n** Error: " msg " **")))   (princ) ) (setq var '("CMDECHO" "ATTREQ") old (mapcar 'getvar var)) (mapcar 'setvar var '(0 1)) (if   (or     (tblsearch "BLOCK" block)     (findfile (strcat block ".dwg"))   )   (if     (and       (setq pre (getstring t "\nSpecify Prefix : "))       (setq val (getint msg))       (progn         (initget 6) (setq scale (getint "\nEnter scale factor: "))       )     )     (while (setq pt (getpoint "\nPick next Point: "))       (command "_.-insert" block "_S" scale "_non" pt "" (strcat pre (itoa val)))       (setq val (1+ val))     )   )   (princ (strcat "\n--> " block ".dwg not Found.")) ) (mapcar 'setvar var old) (princ))
 
BTW, with regards to ATTREQ: If set to 0, you will not be prompted to 'Enter Attributes' when inserting a block, otherwise, if set to 1, the prompt will appear.
回复

使用道具 举报

4

主题

17

帖子

13

银币

初来乍到

Rank: 1

铜币
20
发表于 2022-7-6 10:15:23 | 显示全部楼层
Many thanks, that worked perfectly. I'll stop begging for Lisp help and try to learn some on my own.
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 10:21:24 | 显示全部楼层
You're very welcome   Good luck with your learning!
回复

使用道具 举报

4

主题

17

帖子

13

银币

初来乍到

Rank: 1

铜币
20
发表于 2022-7-6 10:21:36 | 显示全部楼层
Let me know if you ever need any lattice Transmission Towers or tapered tubular poles designed (my area of expertise) and I'll be glad to help.
 
These numbers in boxes are used to define a member size on a schematic drawing. It will tell the structure detailer the angle size, the number of bolts, and number of holes out as well as which leg is bolted, in case you had a burning desire to know how this lisp code is used.
 
I originally created it back last millinium to annotate a drawing. The circles with numbers designated the joint number and the boxes defined the member number when I was doing my structural model of a 3 dimensional truss. The ACAD drawing was used to document the model to see what member went where.
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 10:26:41 | 显示全部楼层
 
Thanks, I'll keep you in mind if I ever have that need
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-7 03:11 , Processed in 0.481420 second(s), 64 queries .

© 2020-2025 乐筑天下

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