找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 904|回复: 5

[求助] 如何判断某个openDCL对话框是否已打开?

[复制链接]
发表于 2017-2-2 19:39:00 | 显示全部楼层 |阅读模式

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

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

×
如何判断某个openDCL对话框是否已打开?
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!

已领礼包: 40个

财富等级: 招财进宝

发表于 2017-2-2 20:28:59 | 显示全部楼层
去看下本版的函数发布提供的函数

http://bbs.xdcad.net/forum.php?m ... sortid&sortid=1
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 6056个

财富等级: 富甲天下

发表于 2017-2-2 22:29:31 | 显示全部楼层
学习了。      
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2017-2-3 10:34:22 | 显示全部楼层
(if (not (setq project-path (dcl_Project_Load "cz_kg.odcl" T)))
    (progn ;项目无法加载,报告或记录错误
       (alert (strcat "* * * 在CAD搜索目录中未找到[" cz_kg.odcl "]文件!"))
       (exit) ;立即退出 (或采取纠正动作并重试)
    )   
    (progn
      (setq intResult2017 (dcl_FORM_SHOW cz_kg_form1))
) )  
我再打开其它opendcl对话框时,只要判断"cz_kg_form1"是否已打开就成,有没有简便的语句?
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 40个

财富等级: 招财进宝

发表于 2017-2-3 11:08:16 | 显示全部楼层

只有非模式对话框你才有这个需求

你去看下我给你的链接,如何判断一个非模式对话框是否是激活状态,里面有代码。
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 1268个

财富等级: 财源广进

发表于 2017-2-6 17:14:11 | 显示全部楼层
本帖最后由 st788796 于 2017-2-6 17:18 编辑

OpenDCL Help

Furthermore, since the dialog may already be active when startup code executes (after opening a second drawing file, for example), it must act accordingly. For example, if the application must read some initialization settings from the registry, it likely needs to do that only when the modeless dialog is initially activated. If such initialization is performed in the dialog's OnInitialize event, it will only get executed once when the dialog is first activated. If the application needs to determine at runtime whether the dialog is already active it can use an expression like the following:

(and MyProject-MyForm (dcl-Form-IsActive MyProject-MyForm))

In addition to programming startup code to act appropriately when more than one drawing is opened, modeless dialogs must also behave correctly when all open drawings are closed (resulting in a state referred to as a "no doc state") or when the user switches between multiple active drawings. If the modeless dialog contains controls whose settings or properties depend on the drawing contents, then it must define event handlers for the OnDocActivated and OnEnteringNoDocState events to update the controls as the document state changes.

非模态对话框除了判断 Form 存在和显示,还应该考虑 文档切换(OnDocActived)以及全部文档关闭后(OnEnteringNoDocState)
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-11 05:00 , Processed in 0.179919 second(s), 41 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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