找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 577|回复: 0

[下载]:microstationV8.0转换CAD时的解决办法!

[复制链接]
发表于 2004-1-7 08:19:28 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
microstationV8.0转换CAD时,线宽不能转换过去,本人写了一段代码,在14下可以变换,共享。望大家提出批评意见!代码如下:
  1. [php]
  2. ////////////////////////////////////
  3. (defun ch1()
  4.    (setq ss (ssget "x" (list (cons 0 "LWPOLYLINE"))))
  5.    (if ss
  6.       (progn
  7.          (princ "\nPlease wait...")
  8.          (setq n 0 m (sslength ss))
  9.          
  10.          (while (< n m)
  11.             (setq entname (ssname ss n))
  12.             (setq enttbl (entget entname))
  13.             (princ "\n")
  14.             (setq w1 (cdr(assoc 40 enttbl)))
  15.             (setq w2 (cdr (assoc 41 enttbl)))
  16.             (setq lw (cdr (assoc 370 enttbl)))
  17.             (if (not (= lw -3.0))
  18.                (progn
  19.                 (setq w1 (/ lw 100.000))
  20.                 (setq w2 (/ lw 100.000))
  21.                 (setq lw -3)
  22.                 (setq enttbl (subst (cons 370 lw) (assoc 370 enttbl ) enttbl ))                              
  23.                 ;(setq enttbl (subst (cons 40 w1) (assoc 40 enttbl ) enttbl ))
  24.                 ;(setq enttbl (subst (cons 41 w2) (assoc 41 enttbl ) enttbl ))
  25.                 (princ "\n")
  26.                 (entmod enttbl)
  27.                 (entupd entname)
  28.                 (command "pedit" entname "w" w1 "")
  29.                )
  30.              )
  31.             (setq n (+ 1 n))
  32.          )
  33.       )      
  34.    )
  35. )
  36. (defun ch2()
  37.    (setq ss (ssget "x" (list (cons 0 "LINE"))))
  38.    (if ss
  39.       (progn
  40.          (princ "\nPlease wait...")
  41.          (setq n 0 m (sslength ss))
  42.          
  43.          (while (< n m)
  44.             (setq entname (ssname ss n))
  45.             (setq enttbl (entget entname))
  46.             (princ "\n")
  47.             (setq w1 (cdr(assoc 40 enttbl)))
  48.             (setq w2 (cdr (assoc 41 enttbl)))
  49.             (setq lw (cdr (assoc 370 enttbl)))
  50.             (if (not (= lw -3.0))
  51.                (progn
  52.                 (setq w1 (/ lw 100.000))
  53.                 (setq w2 (/ lw 100.000))
  54.                 (setq lw -3)
  55.                 (setq enttbl (subst (cons 370 lw) (assoc 370 enttbl ) enttbl ))
  56.                 (princ "\n")
  57.                 (entmod enttbl)
  58.                 (entupd entname)                             
  59.                 (command "pedit" entname "y" "w" w1 "")
  60.                )
  61.              )
  62.             (setq n (+ 1 n))
  63.          )
  64.       )      
  65.    )
  66.    (princ)  
  67. )
  68. (defun c:ch()
  69.    (ch1)
  70.    (ch2)
  71.    (princ "ch:")
  72.    (prompt "本程序用lineweight属性项和width属性项值的改变!")
  73.    (prompt "数据处理完后请检查数据如有问题,请与研发中心联系!029--87862695")
  74.    (prompt "---田江博2003.12.10")
  75.    (princ)  
  76. )

  77. ////////////////////////////////////[/php]
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2025-9-26 22:36 , Processed in 0.176050 second(s), 31 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表