乐筑天下

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

[编程交流] 启动Autoc时打开帮助

[复制链接]

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 2022-7-6 10:34:58 | 显示全部楼层
为了提高效率,我也建议您重新修改代码。
 
我的两分钱。。。
 
  1. ;;;--------------------------------------------------------------------;
  2. ;;; Load personal settings function:
  3. (defun c:LPS  (/ linList [color=#0000ff]linetypesTable[/color] layerTable layerName layerItem
  4.               layerColor layerLineType)
  5. (vl-load-com)
  6. (vla-startundomark
  7.    (cond (*activeDoc*)
  8.          ((setq *activeDoc*
  9.                  (vla-get-activedocument (vlax-get-acad-object))))))
  10. ;; Linetypes check
  11. (foreach lin  '("hidden"
  12.                  "hidden2"
  13.                  "hiddenx2"
  14.                  "center"
  15.                  "center2"
  16.                  "centerx2"
  17.                  "phantom"
  18.                  "phantom2"
  19.                  "phantomx2")
  20.    (if (not (tblsearch "LTYPE" lin))
  21.      (setq linList (cons lin linList))))
  22. [color=blue](if linList[/color]
  23. [color=blue]    (foreach lin  linList[/color]
  24. [color=blue]      (vla-load[/color]
  25. [color=blue]        (cond[/color]
  26. [color=blue]          (linetypesTable)[/color]
  27. [color=blue]          ((setq linetypesTable (vla-get-linetypes *activeDoc*))))[/color]
  28. [color=blue]        lin[/color]
  29. [color=blue]        "acad.lin")))[/color]
  30. ;; Layer check
  31. (foreach lay  '(("BALLOON" "15" "CONTINUOUS")
  32.                  ("BORDER" "33" "CONTINUOUS")
  33.                  ("BOTTOM" "31" "CONTINUOUS")
  34.                  ("CENTER" "35" "CENTER" "")
  35.                  ("CONSTRUCTION" "5" "PHANTOM")
  36.                  ("DIMENSION" "40" "CONTINUOUS")
  37.                  ("FRONT" "83" "CONTINUOUS")
  38.                  ("GHOST" "12" "CONTINUOUS")
  39.                  ("HATCH" "123" "CONTINUOUS")
  40.                  ("HIDDEN" "252" "HIDDEN2")
  41.                  ("PART" "7" "CONTINUOUS")
  42.                  ("REV" "1" "CONTINUOUS")
  43.                  ("SECTION" "5" "PHANTOM2")
  44.                  ("SIDE" "30" "CONTINUOUS")
  45.                  ("NOTES" "40" "CONTINUOUS")
  46.                  ("TOP" "6" "CONTINUOUS"))
  47.    (setq layerTable (vla-get-layers *activeDoc*))
  48.    (if (tblsearch "LAYER" (setq layerName (car lay)))
  49.      (setq layerItem (vla-item layerTable layerName))
  50.      (setq layerItem (vla-add layerTable layerName)))
  51.    (if (/= (setq layerColor (cadr lay)) (vla-get-color layerItem))
  52.      (vla-put-color layerItem layerColor))
  53.    (if (/= (setq layerLineType (caddr lay))
  54.            (vla-get-linetype layerItem))
  55.      (vla-put-linetype layerItem layerLineType))
  56.    ;; <- Additional layer checks go here, eg. freeze, description, etc.
  57.    )
  58. (vla-endundomark *activeDoc*)
  59. (princ))
  60. ;;;--------------------------------------------------------------------;
  61. (if (= 1 (getvar 'dwgtitled))                                           ; If drawing is named,
  62. (c:LPS))                                                              ; Load personal settings
  63. ;;;--------------------------------------------------------------------;
  64. (princ)
回复

使用道具 举报

7

主题

340

帖子

338

银币

初来乍到

Rank: 1

铜币
37
发表于 2022-7-6 10:38:06 | 显示全部楼层
回复

使用道具 举报

4

主题

11

帖子

7

银币

初来乍到

Rank: 1

铜币
20
发表于 2022-7-6 10:42:37 | 显示全部楼层
Thanks all!
 
I will study your revamped code examples and suggestions - it looks like the answer to my original post is in there.
回复

使用道具 举报

59

主题

327

帖子

268

银币

后起之秀

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

铜币
295
发表于 2022-7-6 10:49:28 | 显示全部楼层
Hi Diedesigner,
 
I just happen to read this, maybe I can help because, one day, I had exactly the same problem.
 
It was caused by an  in a lisp routine. Or so to say a "" too much. I cannot tell exactly how and where but I'd say somewhere at the end of a code.
 
What happens is when AutoCAD starts up, the routine is loaded, and an  is given. Just the same as when starting up vanilla AutoCAD; when ready, hit enter and the help pops up.
 
My 2 cents.
回复

使用道具 举报

20

主题

81

帖子

61

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
100
发表于 2022-7-6 10:51:30 | 显示全部楼层
  1. ("center" "35" "center" [b]""[/b])
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-7 00:07 , Processed in 0.846872 second(s), 60 queries .

© 2020-2025 乐筑天下

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