Small Fish 发表于 2022-7-6 12:04:48

Objectdcl示例

大家好,有没有objectdcl的简单示例?
我尝试了objectdcl网站上提供的以下链接,但我得到了旧的链接
“404未找到”消息。
 
http://www.objectdcl.com/knowledgebase/knowledgebase.html
 
谢谢

JohnM 发表于 2022-7-6 12:14:33

你到底在找什么?
如果您下载了opendcl studio,其中包括一些示例。
我从一开始就在使用openDCL,我很喜欢它。
我很乐意帮忙

Small Fish 发表于 2022-7-6 12:28:19

我不确定objectdcl和opendcl之间有什么区别?
我查看了opendcl站点,但仍然找不到任何简单的示例。
你能给我举个简单的例子吗?

JohnM 发表于 2022-7-6 12:38:57

以下是这两个项目的一点背景。
ObjectDCL几年前从加拿大的一个家伙开始,它的价格约为300.00美元+/-(我买了它,但忘记了它的确切价格)。几年前,他生病了,无法继续开发该项目。他将该程序发布为一个开源项目,以便其他程序员可以进一步开发该程序。开源程序对公众来说是免费的,他们可以随心所欲。一家名为DuctiSoft的公司开发了该代码,现在以一定的价格出售,他们还获得了该软件的原始名称。另一组开发人员接受了代码并继续开发,将其命名为OpenDCL,并将代码或打包的程序免费分发给公众。我更喜欢免费的,但有一些问题,如果必要的话,我可以在后面详细讨论。
 
我建议下载当前稳定的OpenDCL版本。
这是下载的链接
http://sourceforge.net/projects/opendcl/files/Development/OpenDCL.Studio.ENU.6.0.0.15.msi/download
如果没有下载,您可能需要单击直接链接或镜像链接。
将下载保存到文件夹中,然后运行它以安装OpenDCL studio。
这将在您的计算机上安装主环境和运行时文件。
安装后,导航到C:\Program Files\OpenDCL Studio\chs\Samples
在那里你会发现一个自述文件和很多例子。
 
OpenDCL(和objectDCL)要求运行您创建的任何程序的计算机安装运行时ARX文件。因此,如果您创建了一个要分发的程序,您必须确保将运行时文件和语言文件夹打包在一起。
当您安装opendcl studio时,运行时文件安装在您的计算机上,位于c:\program files\common files\opendcl。此外,还安装了不同的语言文件。
 
包括的例子和我能给你展示的一样好。
试一试,如果你想继续,我很乐意帮助你组织起来,让你走上正确的道路。
起初这一切看起来都很可怕,但当你熟悉了这个过程后,你会喜欢它的。
 
下面简要介绍一下它的基本工作原理。
 
在工作室制作一个表单,然后在其上放置两个按钮。
所有对象、窗体和按钮或其他工具都具有属性和事件
属性示例类似于按钮上显示的文本,事件示例类似于单击按钮。如果用户单击按钮,您希望执行什么代码
 
因此,在lisp代码中,首先要确保运行时。ARX文件已加载,然后确保项目已加载,然后调用事件以用2个按钮显示表单。
假设一个按钮将执行此lisp命令(警报“Hello World”),因此当用户单击该按钮时,AutoCAD消息框将出现。另一个按钮将用于关闭表单,以便用户可以退出程序。

Small Fish 发表于 2022-7-6 12:41:21

感谢John的详细解释,以及如何使用它的基本知识。大约5-6年前,我玩过它(当时Chad负责),但由于缺乏文档或示例,我放弃了。同时,普通的老dcl或多或少做了我想要的。所以现在我想我可能会再次访问这个软件。不幸的是,由于管理员权限,目前我无法运行它。我会让IT部门让它工作。

Small Fish 发表于 2022-7-6 12:50:01

下载了opendcl并尝试了教程。我承认这看起来有点难理解。制作一个对话框看起来不太难,但我不知道如何将对话框与代码联系起来?
我想知道你或其他人是否可以转换下面的简单代码,使其与opendcl一起运行?
我想如果有人能让我开始,我希望能解决剩下的问题。
 
(defun C:AreaSq (/ areaunitsss      n         attlst
         lstpnt   inspnt      areametres areametresmm
         oldcmd   olddzi      oldlay   oldosm
         outent   rtosnum)
(AreaSqdcl)
(setq    OldDzi (getvar "DIMZIN");save all used sysvars
   OldCmd (getvar "CMDDIA")
);setq
   
(setvar "CMDECHO" 0);supress command prompts
(if (= (logand (getvar "UNDOCTL") 4) 4);if UNDO-mode 'Auto', then
(command "_.UNDO" "_GROUP");start UNDO-group
);if
(setvar "DIMZIN" (boole 4 8 OldDzi));set zero-supression
(setvar "TOOLTIPS" 1)
(setq DwgUnits (getvar "INSUNITS" )
       AreaUnits 0
         ss (ssget '((0 . "HATCH,CIRCLE,ELLIPSE,SPLINE,POLYLINE,LWPOLYLINE"))))
(if   ss
(progn
(setq n (1- (sslength ss)))
(while (>= n 0)
(command "_.AREA" "_OBJECT" (ssname ss n))
(setq AreaUnits (+ AreaUnits (getvar "AREA"))
       n (1- n))
);while


(if
(= SquareUnit "squaremetres" )
(progn
(setq rtosNum (atoiDeciPlaces )
       AreaMetres (rtos AreaUnits2 RtosNum)
);setq
   
(alert(strcat"\n" "Area = " AreaMetres "m²"))
);progn
);if


(if
(= SquareUnit "squaremillimetres" )
(progn
(setq rtosNum (atoiDeciPlaces )
       AreaMetresmm (rtos(* AreaUnits 1000)2 RtosNum)
);setq
   
(alert(strcat"\n" "Area = " AreaMetresmm "mm²"))
);progn
);if


);progn
(alert "\nNo Polylines selected!")
);if
   
(setvar "DIMZIN" OldDzi)
(if (= (logand (getvar "UNDOCTL") 4) 4)
(command "_.UNDO"
      "_END"
      "_.UNDO"
      "_MARK"
);command
);if
(setvar "CMDECHO" OldCmd)
(princ)
);defun

;-------------
; DCL Function
;-------------
(defun AreaSqdcl (/ReturnValue SquareUnitTile)
(defun CheckOnClose (/ )
(cond
((not (setq SquareUnitTile (get_tile "SquareUnit")));if no buttons filled
(mode_tile "SquareUnit" 2)
)
(T
(setq
       SquareUnit   (substr SquareUnitTile 1)
   DeciPlaces   (nth (read (get_tile "DeciPlaces"))DeciPlacesList)
);setq
(done_dialog 1)
);T
);cond

);defun CheckOnClose

(if (> (setq DLGID (load_dialog "AreaSq.dcl")) 0)
(progn
(new_dialog "AreaSq" DLGID)

(setq DeciPlacesList '("None" "1" "2" "3" ))
(start_list "DeciPlaces")
(mapcar 'add_listDeciPlacesList)
(end_list)
(if (member DeciPlaces DeciPlacesList);see if the global variable is an available option in the list
(set_tile "DeciPlaces" (rtos (vl-position DeciPlaces DeciPlacesList) 2 0));if it is, set it as default
(set_tile "DeciPlaces" "1");if not, set the default to item 2 in list)
);if

(action_tile "DeciPlaces" "(ErrorDLG 0)")
(action_tile "accept" "(CheckOnClose)")
(action_tile "cancel" "(exit)")

(setq ReturnValue(start_dialog))
(unload_dialog DLGID)
);progn
(not (princ "\nNo DCL"))
);if
ReturnValue
);defun AreaSqdcl

(defun ErrorDLG (pErr)
(cond
((= pErr 0) (set_tile "error" ""))
);cond
);defun


 
dcl_settings : default_dcl_settings { audit_level = 3 ; }
AreaSq : dialog {
key = "Display" ;
label = "Area of an entity" ;
:boxed_radio_row   {
fixed_width = true ;
key = "SquareUnit";
:radio_button {
label ="Square metres                  " ;
key = "squaremetres" ;
value = "1";
}
:radio_button {
label ="Square millimetres   " ;
key = "squaremillimetres" ;
}
}//End radio row

:boxed_column {
width = 1 ;
:popup_list {
label = "Number of Decimal Places                        ";
key = "DeciPlaces" ;
}//popup list
   }//boxed column

errtile ;
ok_cancel ;
}//dialog

anduc 发表于 2022-7-6 13:00:48

嗨,小鱼,
 
您可以查看ObjectDCL网站“支持”部分下的“在线帮助”。
 
这里有你需要的所有文件。
 
不要羞于通过电子邮件直接联系DuctiSoft。

BazzaCAD 发表于 2022-7-6 13:07:24

 
 
嗨,小鱼,
只需查看OpenDCL初学者教程,您将学习如何创建对话框,并将它们快速链接到您的代码。
转到OpenDCL并单击顶部的“教程”选项卡。
页: [1]
查看完整版本: Objectdcl示例