乐筑天下

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

所以我偶然发现了这个启示(对我来说是一个启示)

[复制链接]

10

主题

90

帖子

15

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
120
发表于 2004-2-9 23:55:36 | 显示全部楼层 |阅读模式
我在这里发布了几次。 事实上,我是Lisp的新手(1-2周),并且很好地掌握了它。 我发布了一个用于创建高程线的lisp文件。 非常简单。 非常适合我。 它要求两层楼的板高和一楼的地板结构,所有这些都是输入的。 难道我不能创建一个对话框从中挑选它们吗?
所以我遇到了DCL,但不想深入研究。 然后是VBA。 非常简单。 制作了我的对话框,我可以在其中选择预设按钮,并且可以毫无问题地将这些按钮输入到Lisp中。 正在寻找如何将我的Lisp与VBA相结合,发现我无法做到这一点。 有人能给我指出我现在需要去的方向吗?

本帖以下内容被隐藏保护;需要你回复后,才能看到!

游客,如果您要查看本帖隐藏内容请回复
回复

使用道具 举报

18

主题

222

帖子

51

银币

后起之秀

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

铜币
260
发表于 2004-2-10 03:37:54 | 显示全部楼层
从VBA内部调用Lisp是可能的,但这并不太好,无论如何都要避免。我的建议是...因为您已经创建了对话框...你已经看到了VBA的一些优势..那么为什么不继续VBA的项目呢?
从好的方面来说,你可以学习另一种语言!而且变得越来越容易!
记得在遇到困难时问一声
回复

使用道具 举报

154

主题

1274

帖子

8

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1936
发表于 2004-2-10 06:36:34 | 显示全部楼层

说得好!
当然,一旦你学会了面向对象语言的语法,继续做更大更好的事情就变得相对容易了。
当您需要对AutoCAD对象进行更多的控制时,VBA非常有用,仍然有一些事情最好用lisp来完成,但这是很少的。欢迎来到VBA的奇妙世界...
回复

使用道具 举报

10

主题

90

帖子

15

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
120
发表于 2004-2-10 19:12:25 | 显示全部楼层
好。。。好吧,我完成了它...在DCL中,就是这样。 我会尽快尝试进入VBA,但我仍在学习Lisp。 如果有人想看,我会发布它。 是时候回家阅读更多关于这一切的信息了。
回复

使用道具 举报

154

主题

1274

帖子

8

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1936
发表于 2004-2-10 21:15:22 | 显示全部楼层
好吧,我不确定每个人都会有什么用,但是,我可以向你保证,你可能会得到一些关于你的编程方法的质量反馈。
回复

使用道具 举报

10

主题

90

帖子

15

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
120
发表于 2004-2-11 01:39:56 | 显示全部楼层
我不认为有人会用得上它...除了批评...就这样...就是这么一件小事,却让我印象如此深刻!我的下一步是创建图层,如果它们不在绘图中的话。DCL文件:
  1. ELines : dialog {
  2.         label = "Elevation Line Setup" ;
  3.         : boxed_radio_row {
  4.         label = "First Floor Ceiling Height" ;
  5.         : radio_button {
  6.           key = "opt1" ;
  7.           label = "8 Foot" ;
  8.           }
  9.         : radio_button {
  10.           key = "opt2" ;
  11.           label = "9 Foot" ;
  12.           value = "1" ;
  13.           }
  14.         : radio_button {
  15.           key = "opt3" ;
  16.           label = "10 Foot" ;
  17.           }
  18. }
  19.         : boxed_radio_row {
  20.         label = "Second Floor Ceiling Height" ;
  21.         : radio_button {
  22.           key = "opt4" ;
  23.           label = "8 Foot" ;
  24.           value = "1" ;
  25.           }
  26.         : radio_button {
  27.           key = "opt5" ;
  28.           label = "9 Foot" ;
  29.           }
  30.         : radio_button {
  31.           key = "opt6" ;
  32.           label = "10 Foot" ;
  33.           }
  34. }
  35.         : boxed_radio_row {
  36.         label = "First Floor Construction" ;
  37.         : radio_button {
  38.           key = "opt7" ;
  39.           label = "2x10" ;
  40.           value = "1" ;
  41.         }
  42.         : radio_button {
  43.           key = "opt8" ;
  44.           label = "2x12" ;
  45.           }
  46. }
  47.         : boxed_radio_row {
  48.         label = "Second Floor Construction" ;
  49.         : radio_button {
  50.           key = "opt9" ;
  51.           label = "2x10" ;
  52.           value = "1" ;
  53.           }
  54.         : radio_button {
  55.           key = "opt10" ;
  56.           label = "2x12" ;
  57.           }
  58. }
  59.         ok_cancel ;
  60.         : row {
  61.         : paragraph {
  62.         : text_part {
  63.         label = "Designed and Created" ;
  64.         }
  65.         : text_part {
  66.         label = "by Dominic Cesare" ;
  67.         }
  68.         }
  69.         }
  70.         }

LISP文件:
  1. (prompt "\nType Elines to run.....")                                ;informs user how to run lisp
  2. (defun c:ELines ()                                                ;define function
  3.   (setq echo (getvar "cmdecho"))                                ;gets echo value
  4.   (setq HT1 "109")                                                ;set default HT1 value
  5.   (setq HT2 "97")                                                ;set default HT2 value
  6.   (setq FC1 "11.5")                                                ;set default FC1 value
  7.   (setq FC2 "10")                                                ;set default FC2 value
  8.   
  9.   (setq dcl_id (load_dialog "ELines.dcl"))                        ;load dialog
  10.   (if (not (new_dialog "ELines" dcl_id)                                ;test for dialog
  11.            )                                                        ;not
  12.     (exit)                                                        ;exit if no dialog
  13. )
  14.     (action_tile "opt1" "(setq HT1 "97")")                        ;store HT1 to 8'-1"
  15.     (action_tile "opt2" "(setq HT1 "109")")                        ;store HT1 to 9'-1"
  16.     (action_tile "opt3" "(setq HT1 "121")")                        ;store HT1 to 10'-1"
  17.     (action_tile "opt4" "(setq HT2 "97")")                        ;store HT2 to 8'-1"
  18.     (action_tile "opt5" "(setq HT2 "109")")                        ;store HT2 to 9'-1"
  19.     (action_tile "opt6" "(setq HT2 "121")")                        ;store HT2 to 10'-1"
  20.   
  21.     (action_tile "opt7" "(setq FC1 "11.5")")                        ;store FC1 to 11 1/2"
  22.     (action_tile "opt8" "(setq FC1 "13.5")")                        ;store FC1 to 1'-0 1/2"
  23.     (action_tile "opt9" "(setq FC2 "10")")                        ;store FC2 to 10"
  24.     (action_tile "opt10" "(setq FC2 "12")")                        ;store FC2 to 12"
  25.     (action_tile
  26.       "cancel"                                                        ;if cancel button is pressed
  27.       "(done_dialog) (setq userclick nil)"                        ;close dialog, set flag
  28.       )                                                                ;end action_tile
  29.     (action_tile
  30.       "accept"                                                        ;if O.K. is pressed
  31.       "(done_dialog) (setq userclick T))"                        ;close dialog, set flag
  32.         )
  33.     (start_dialog)                                                ;start dialog
  34.     (unload_dialog dcl_id)                                        ;unload
  35.   (if userclick
  36.     (progn
  37.   
  38.   (setq DN '(0 -100000000)
  39.         UP '(0 100000000)
  40.         )
  41. ;;; ***************  Creating Grade & Top of Foundation   ****************
  42. (prompt "\nDraw Grade Line.....")
  43.   (setvar "cmdecho" 0)
  44.   
  45.   (command "line" pause pause "")                                ;creating grade line
  46.   (setq L1 (entlast))                                                ;setting grade line to L1
  47.   (command "change" L1 "" "P" "LA" "WALL" "C" "WHITE" "")        ;changing grade line to layer wall, color white
  48.   (command "offset" "8.0" L1 UP "")                                ;creating top of foundation line
  49.   (setq FDN (entlast))                                                ;setting top of foundation line to FDN
  50.   (command "change" FDN "" "P" "LA" "WALL" "C" "15" "")                ;changing top of foundation line to layer wall, color 15
  51. ;;; ***************  Creating First Floor Lines   ************************
  52.   (command "offset" FC1 FDN UP "")                                ;creating first floorline
  53.   (setq FLR1 (entlast))                                                ;setting first floorline to FLR1
  54.   (command "change" FLR1 "" "P" "LA" "FLR" "C" "BYLAYER" "")        ;changing first floorline to layer FLR, color bylayer
  55.   (command "offset" HT1 FLR1 UP "")                                ;creating first floor ceilingline
  56.   (setq CLG1 (entlast))                                                ;setting first floor ceilingline to CLG1
  57.   (command "change" CLG1 "" "P" "LA" "CLG" "")                        ;changing first floor ceilingline to layer CLG
  58.   
  59. ;;; *************** Creating First Floor Fascia **************************
  60.   (command "offset" "3.0" CLG1 DN "")                                ;creating top of first floor fascia
  61.   (setq F1T (entlast))                                                ;setting top of first floor fascia to F1T
  62.   (command "change" F1T "" "P" "LA" "WALL" "")                        ;changing top of first floor fascia to layer WALL
  63.   (command "offset" "8.0" F1T DN "")                                ;creating bottom of first floor fascia
  64.   (setq F1B (entlast))                                                ;setting bottom of first floor fascia to F1B
  65. ;;; *************** Creating Second Floor Lines **************************
  66.   (command "offset" FC2 CLG1 UP "")                                ;creating second floorline
  67.   (setq FLR2 (entlast))                                                ;setting second floorline to FLR2
  68.   
  69.   (command "change" FLR2 "" "P" "LA" "FLR" "")                        ;changing second floorline to layer FLR
  70.   
  71.   (command "offset" HT2 FLR2 UP "")                                ;creating second floor ceilingline
  72.   
  73.   (setq CLG2 (entlast))                                                ;setting second floor ceilingline to CLG2
  74.   (command "change" CLG2 "" "P" "LA" "CLG" "")                        ;changing second floor ceilingline to layer CLG
  75. ;;; *************** Creating Second Floor Fascia **************************
  76.   
  77. (command "offset" "3.0" CLG2 DN "")                                ;creating top of second floor fascia
  78. (setq F2T (entlast))                                                ;setting top of second floor fascia to F2T
  79. (command "change" F2T "" "P" "LA" "WALL" "")                        ;changing top of second floor fascia to layer WALL
  80. (command "offset" "8.0" F2T DN "")                                ;creating bottom of second floor fascia
  81. (setq F2B (entlast))                                                ;setting top of second floor fascia to F2B
  82.   (setvar "cmdecho" echo)
  83.   )
  84.     )
  85.     (princ)
  86. )
  87.   (princ)

回复

使用道具 举报

1

主题

32

帖子

3

银币

初来乍到

Rank: 1

铜币
36
发表于 2004-2-11 16:54:23 | 显示全部楼层
这里有几篇你可能会觉得有趣的文章。反正比DCL更有趣
http://code.acadx.com/articles/005.htm
http://code.acadx.com/articles/002.htm
回复

使用道具 举报

10

主题

90

帖子

15

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
120
发表于 2004-2-12 05:25:37 | 显示全部楼层
嘿鲍比,很高兴见到你。希望一切都好。
这些文章很棒。谢了。斯蒂格·麦德森
回复

使用道具 举报

10

主题

90

帖子

15

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
120
发表于 2004-2-13 13:55:13 | 显示全部楼层
嗨,斯蒂格!
好久不见。 我会在附近一点。我很高兴你喜欢这些文章!
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-15 14:15 , Processed in 0.446809 second(s), 81 queries .

© 2020-2025 乐筑天下

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