为何在opendcl里面修改了面板的数量后(如下图),在CAD中操作界面依然是4行3列?
原贴见http://bbs.mjtd.com/forum.php?mod=viewthread&tid=99759&extra=&highlight=%D2%FE%B2%D8&page=1;有个问题想请教一下,为何在opendcl里面修改了面板的数量后(如下图),在CAD中操作界面依然是4行3列?
(defun gxl-AutoLoadODclArx(/ loaded fn v fnn)
(if (not dcl_getversionex)
(VL-CATCH-ALL-APPLY 'vl-cmdf (list "opendcl"))
)
(if (not dcl_getversionex)
(cond
((= "16" (setq v (itoa (atoi (getvar 'acadver)))))
(if
(setq fnn (findfile (setq fn (strcat "opendcl." v ".arx"))))
(setq loaded (arxload fnn "1"))
(setq loaded "2")
)
)
((or (= "17" v) (= "18" v) (= "19" v))
(if (= "x86" (getenv "PROCESSOR_ARCHITECTURE"))
(if (setq fnn
(findfile (setq fn (strcat "opendcl." v ".arx"))))
(setq loaded (arxload fnn "1"))
(setq loaded "2")
)
(if (setq fnn
(findfile (setq fn (strcat "opendcl." v "x64.arx"))))
(setq loaded
(arxload fnn
"1"))
(setq loaded "2")
)
)
)
(t (Setq loaded "2"))
)
(setq loaded "3") ;_ 已加载
)
(if (= "1" loaded)
(progn
(princ (strcat fn "加载失败!程序将退出!"))
(exit)
)
(if (= "2" loaded)
(progn
(princ
(strcat "未找到对应的\"" fn "\"文件!程序将退出!"))
(exit)
)
)
)
loaded
)
(defun gxl-Load_ODCL_Project ( projname reload password alias / bytes rtype Projects)
(cond
( (null dcl_project_import)
(princ "需OpenDCL 5.0 以上版本支持.\n")
nil
)
( (and
(setq bytes (vl-get-resource projname))
(eq 'str (setq rtype (type bytes)))
(not (eq "" bytes))
)
(if reload
(dcl_project_import bytes password alias)
(if (or
(not (setq Projects (dcl_GetProjects)))
(not (member (strcase (vl-filename-base projname)) (mapcar 'strcase Projects)))
)
(dcl_project_import bytes password alias)
)
)
)
((dcl_project_load (findfile projname) reload alias ))
)
)
;;鼠标移动隐藏对话框主程序加载
(defun c:AutoHide()
(gxl-AutoLoadODclArx)
(gxl-Load_ODCL_Project "AutoHide.odcl" t nil nil)
(setq bFlag t)
(dcl_form_show AutoHide_Form1)
(if (not (dcl_Form_IsActive AutoHide_Form1))
(progn
(dcl_form_show AutoHide_Form1)
)
)
(princ)
)
;;初始化对话框
(defun c:AutoHide_Form1_OnInitialize (/ scr pos)
(setq scr (dcl_getscreensize))
(setq pos (getenv "隐藏对话框初始位置"))
(if pos
(setq pos (read pos)
*FormX (car pos) *FormY (cadr pos)
)
(setq *FormX (fix (* 0.5 (car scr))) *FormY 5)
)
(setenv "隐藏对话框初始位置" (strcat "(" (itoa *FormX) " " (itoa *FormY) ")"))
(dcl_Control_SetPos AutoHide_Form1 *FormX *FormY 70 25)
(princ)
)
;;对话框移动
(defun c:AutoHide_Form1_OnMove (NewX NewY /)
(if (not bFlag)
(progn
(setq *FormX NewX
*FormY NewY)
(setenv "隐藏对话框初始位置"
(strcat "(" (itoa *FormX) " " (itoa *FormY) ")"))
)
(setq bFlag nil)
)
(princ)
)
;;鼠标进入对话框,则展开对话框
(defun c:AutoHide_Form1_OnMouseEntered (/ scr)
(vl-bb-set '*FormExtend* t)
(setq scr (dcl_getscreensize))
;(dcl_Control_SetPos AutoHide_Form1 (fix (* 0.5 (car scr))) 5 240 150)
(dcl_Control_SetPos AutoHide_Form1 *FormX *FormY 240 150)
(princ)
)
;;自动隐藏对话框
(defun c:AutoHideForm (/ scr)
(if (not (vl-bb-ref '*FormExtend*))
(progn
(setq scr (dcl_getscreensize))
;(dcl_Control_SetPos AutoHide_Form1 (fix (* 0.5 (car scr))) 5 70 25)
(dcl_Control_SetPos AutoHide_Form1 *FormX *FormY 70 25)
)
)
(princ)
)
;;鼠标离开对话框,则隐藏对话框
(defun c:AutoHide_Form1_OnMouseMovedOff (/ )
(vl-bb-set '*FormExtend* nil)
(dcl_delayedinvoke 800 "c:AutoHideForm") ;_ 延迟800毫秒隐藏对话框
(princ)
)
;;关闭对话框
(defun c:AutoHide_Form1_TextButtonOK_OnClicked (/)
(dcl_form_close AutoHide_Form1)
(setq *FormX nil*FormY nil)
(princ)
)
;;无文档时自动关闭对话框
(defun c:AutoHide_Form1_OnEnteringNoDocState (/)
(vl-bb-set '*FormExtend* nil)
(dcl_form_close AutoHide_Form1)
(setq *FormX nil*FormY nil)
(princ)
)
;;单行文字命令
(defun c:AutoHide_Form1_TextButton0_OnClicked (/)
(dcl_sendstring "text ")
)
;;其他命令可自行添加代码 本帖最后由 注册 于 2021-6-20 10:00 编辑
这个问题自己解决了,修改70和25两个数值即可 6666pppp哈哈
页:
[1]