创建自定义对象。 支持的平台:仅窗口 签名工 务 局: RetVal = object.AddCustomObject(ClassName) 返回值(RetVal)类型:自定义对象 新创建的自定义对象。 言论必须加载定义 rxClassName 自定义类的 ObjectARX DLL。在应用程序对象上使用 LoadARX 方法显式加载 ObjectARX 文件。 例子工 务 局: Sub Example_AddCustomObject() ' This example adds a custom object to model space. ' Load the ObjectARX application that defines the custom object. ' Note: The application listed here does not exist and ' will cause an error when run. Change the application name ' to the path and name of your ObjectARX Application. ThisDrawing.Application.LoadArx "MyARXApp.dll" ' Once the application has been loaded successfully, ' add the custom object to model space. Dim customObj As AcadObject Set customObj = ThisDrawing.ModelSpace.AddCustomObject("MyNewObject") End Sub Visual LISP: (vl-load-com) (defun c:Example_AddCustomObject() ;; This example adds a custom object to model space. (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) ;; Load the ObjectARX application that defines the custom object. ;; Note: The application listed here does not exist and ;; will cause an error when run. Change the application name ;; to the path and name of your ObjectARX Application. (vla-LoadArx acadObj "MyARXApp.dll") ;; Once the application has been loaded successfully, ;; add the custom object to model space. (setq customObj (vla-AddCustomObject (vla-get-ModelSpace doc) "MyNewObject")) ) |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:35
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.