明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2613|回复: 3

[求助]用VBA如何调出CAD的颜色属性对话框,之后,如何获得所选的颜色号

[复制链接]
发表于 2004-9-29 11:11:00 | 显示全部楼层 |阅读模式
斑竹和各位大侠: 用VBA如何调出CAD的颜色属性对话框,之后,如何获得所选的颜色号。能不能与lisp结合得到呢?请给个例子。谢了!
发表于 2004-9-29 19:20:00 | 显示全部楼层
Reply From: Oquendo, Frank
Date: Jul/13/00 - 18:18 (GMT)

Re: Using the Color Dialog
I don't know about the File dialog (maybe GETFILED will work) but I do know
that you can use the VisualLISP ActiveX Module to call the ACAD_COLORDLG
function and receive its return value. If you're not familiar with the
VisualLISP ActiveX Module, I have a free wrapper class in the download
section of my web site. It's called VLAX (pretty original, huh?) Using it,
you can call the color dialog like so: Dim objVLAX As New VLAX, retVal
retVal = objVLAX.EvalLispExpression("(acad_colordlg 3 nil)") Be sure to add the class module to your project and also be sure to type
(VL-LOAD-COM) at the command line before running.
发表于 2004-9-30 09:58:00 | 显示全部楼层
Private Declare Function acedSetColorDialog Lib _
"acad.exe" (color As Long, ByVal bAllowMetaColor _
As Boolean, ByVal nCurLayerColor As Long) As Boolean Public Function ChooseColor(ByVal lngInitClr As Long, _
ByVal blnMetaColor As Boolean, _
ByVal lngCurClr As Long) As Long
ChooseColor = -1
On Error Resume Next
If acedSetColorDialog(lngInitClr, blnMetaColor, lngCurClr) Then
ChooseColor = lngInitClr
End If
On Error GoTo 0
End Function

评分

参与人数 1威望 +1 金钱 +10 贡献 +10 激情 +10 收起 理由
雪山飞狐_lzh + 1 + 10 + 10 + 10 【好评】好程序

查看全部评分

 楼主| 发表于 2004-9-30 10:11:00 | 显示全部楼层
谢了!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-27 22:21 , Processed in 0.184509 second(s), 27 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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