明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 912|回复: 4

[基础] 请问群码变更后为什么图型不会变化?

[复制链接]
发表于 2011-1-13 10:39:32 | 显示全部楼层 |阅读模式
各位好想请各位老师帮忙看看下面
lsp是哪错了?我执行完程序后我再次查询群码及点击像素所显示的比例均是我更改过的比例为什么图型不会变化? 谢谢!!

(defun c:chght()
(setvar "cmdecho"0)

(setq en(entsel"
选取 HATCH 图型:"))
(setq en_data(entget(car en)))

(setq hatch_list(assoc41 en_data))

(setq old_hatchscale(cdr hatch_list))

(princ "\n
现有 HATCH比例=")(princold_hatchscale)
(setq new_hatchscale(getreal "\n
新的 HATCH 比例:"))
(setq new_hatch_list(cons 41 new_hatchscale))

(setq new_data(substnew_hatch_list hatch_list en_data))

(entmod new_data)

(prin1)
)(prompt "***************** <<C:CHGHT>>*******************")(prin1)
发表于 2011-1-13 11:14:08 | 显示全部楼层
請參閱 EntUpd 函數的使用說明
 楼主| 发表于 2011-1-13 15:20:00 | 显示全部楼层

感谢Andyhon的指导!!

我有去查了说明
无耐小弟刚学能力有限
还是搞不定!
请问哪位大哥可以帮我修改一下上面的程序吗?
谢谢!!
发表于 2011-1-13 16:05:53 | 显示全部楼层
Sorry!
改用ActiveX

  1. (defun c:chght()
  2.    (setvar "cmdecho"0)
  3.    (setq en (entsel"選取 HATCH 圖型:"))
  4.    (setq en (car en))
  5.    (setq en_data (entget en))
  6.    (setq hatch_list(assoc 41 en_data))
  7.    (setq old_hatchscale(cdr hatch_list))
  8.    (princ "\n現有 HATCH比例=")(princ old_hatchscale)
  9.    (setq new_hatchscale(getreal "\n 新的 HATCH 比例:"))
  10.    (vlax-put (vlax-ename->vla-object en) 'PatternScale new_hatchscale)
  11.    (prin1)
  12. )
 楼主| 发表于 2011-1-13 16:20:06 | 显示全部楼层
回复 Andyhon 的帖子

感謝您!!
程式ok了!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-10-2 18:33 , Processed in 0.165031 second(s), 32 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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