乐筑天下

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

[编程交流] More AutoCAD-like programs

[复制链接]

35

主题

2471

帖子

2447

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
174
发表于 2022-7-6 12:01:29 | 显示全部楼层
@Lee, are you learning Python also? Since their examples are recommended to be based on “Spam, Eggs and Bacon”…
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 12:03:03 | 显示全部楼层
No I'm not actually - I'm learning (or trying to learn) C++, Eggs and Bacon was just the first thing that came to mind... I was hungry I suppose
回复

使用道具 举报

31

主题

170

帖子

139

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
155
发表于 2022-7-6 12:07:10 | 显示全部楼层
I got a coupe more questions...
 
With this code:
 
  1. (setq tpm (if     (getkword       (strcat "\nSetting to Change [Face type/Array type/"        (if (= art "Rectangular") "Oscillation")        "/Layer/Hide edges/]: "))     "Continue"))
 
I'm getting this in my commmand line:
 
 
**My main problem is that the line for "Setting to Change..." is broken into 2 lines, is there a way to force this onto one line? I have plenty of room in my command line yet, so I don't believe its a margins thing. Anybody got any ideas??? ** -Disregard this question... when the user is prompted it shows up on one line, then changes...
 
The other, alot more minor thing, is that I would like to underline the "Current Settings" line of text in the command line. Is this possible?
回复

使用道具 举报

31

主题

170

帖子

139

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
155
发表于 2022-7-6 12:10:07 | 显示全部楼层
Nevermind found it.... needed "( (eq tpm "Cont")", not ( (eq tmp "Cont")"
 
Can someone please tell me why my loop won't end???
 
  1. ;  ___________________________________________________________________________________________  ;;      i. Top Menu                                                                              ;;  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯  ;     (while (not ext)(princ "\n \nCurrent Settings: ")(princ (strcat "\nFace Type: " fat))(princ (strcat "\nArray Type: " art))(if (= art "Rectangular")  (princ (strcat "\nOscillation: " osc)))(princ (strcat "\nLayer: "        (if (= las "Temp") "Temp" (getvar 'clayer))))(princ (strcat "\nHide Edges: " hed))(initget "Face Array oScill layeR hidE Cont")(setq tpm (cond     ( (getkword  (strcat "\nSetting to Change [Face type/Array type/oScillation/layeR/"   "hide Edges/]: ")))     ("Cont")));  ___________________________________________________________________________________________  ;;      i. Face Type                                                                             ;;  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯  ;(cond  ( (eq tpm "Face")   (initget "First miDdle lAst")          (setq fat (cond                 ( (getkword (strcat "\nFace Type? ["            (if (= fat "First" ) ""  "First" )         "/"              (if (= fat "miDdle") "" "miDdle")         "/"              (if (= fat "lAst"  ) ""   "lAst"  )         "]: ")))              (fat)))            )           ;  ___________________________________________________________________________________________  ;;      ii. Array Type                                                                           ;;  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯  ;  ( (eq tpm "Array")   (initget "Rectangular Circular")          (setq art (cond                 ( (getkword             (strcat "\nArray Type? ["            (if (= art "Rectangular") "" "Rectangular")       "/"              (if (= art "Circular"   ) ""    "Circular"   )       "]: ")))               (art)))            );  ___________________________________________________________________________________________  ;;      iii. Third and Fourth Point Selection Oscillation                                        ;;  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯  ;  ( (eq tpm "oScill")    (if (= art "Circular")      (progn (initget "Yes No") (setq cat (cond      ((getkword (strcat "\nArray type is not currenty set to "           "rectangular, change to circular? [/No]: "           )))      ("Yes"))) (if (= cat "Yes")   (setq osc "Yes"  art "Rectangular")   )))   );  ___________________________________________________________________________________________  ;;      iii. Layer selection                                                                     ;;  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯  ;  ( (eq tpm "layeR")   (initget "Current Temp")            (setq las (cond                  ( (getkword (strcat "\nLayer? ["             (if (= las "Current") "" "Current")         "/"              (if (= las "Temp"   ) ""    "Temp"   )         "]: ")))              (las)))            );  ___________________________________________________________________________________________  ;;      iv. Hide edges                                                                           ;;  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯  ;  ( (eq tpm "hidE")   (initget "Yes No")             (setq hed (cond                 ( (getkword (strcat "\nHide Inside Edges? [/No]: ")))          (hed)))            );  ___________________________________________________________________________________________  ;;      iv. End Loop (Continue)                                                                  ;;  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯  ;  ( (eq tmp "Cont")   (setq ext 1)   )  )           )              
 
I'm guessing its going to be a little detail, but I can't find it.
回复

使用道具 举报

54

主题

3755

帖子

3583

银币

后起之秀

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

铜币
438
发表于 2022-7-6 12:11:55 | 显示全部楼层
LoL
Lee, you were talking about being immature...
 
  1. (princ (strcat "\nFace Type: " [color=Red]fa[/color]t))(princ (strcat "\nArray Type: " a[color=Red]rt[/color]))
 
[i play a lot of boggle.]
回复

使用道具 举报

31

主题

170

帖子

139

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
155
发表于 2022-7-6 12:16:52 | 显示全部楼层
lol, very nice
回复

使用道具 举报

31

主题

170

帖子

139

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
155
发表于 2022-7-6 12:20:43 | 显示全部楼层
I keep coming up with more questions.... but how would I change a prompt to accept a mouse click in addition to a text input.
 
And then if it was a mouse click, how would use the coordinates of that point and apply it to a variable?
 
Not sure if this makes 100% sense, so for an example look at the autocad arc command, after you initiate the are command you have an option you can activate by hitting the "c" key, or you can click and it accepts that as the first point of the arc.
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 12:23:06 | 显示全部楼层
*Hint* Fully read about initget in the Developer Help
回复

使用道具 举报

31

主题

170

帖子

139

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
155
发表于 2022-7-6 12:25:05 | 显示全部楼层
I did, and I understand that if you use 128 as the bit-code for the initget function that it will allow you to inputer keyboard entries into a getpoint function, but I don't see how that combines the getkword to make sure the user is only entering either the options you give them, or a point.
 
Sorry if I'm being thick, I'm just not very good at figuring this kind of stuff out fromt the help files.
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 12:29:02 | 显示全部楼层
How about this part
 
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-6 02:24 , Processed in 0.392311 second(s), 70 queries .

© 2020-2025 乐筑天下

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