Creates a custom object.
Supported platforms: Windows only
VBA:
RetVal = object.AddCustomObject(ClassName)
Type: Block, ModelSpace, PaperSpace
The objects this method applies to.
Access: Input-only
Type: String
The rxClassName must be defined in an ObjectARX® application (ObjectARX DLL) or the method will fail.
Type: Custom object
The newly created Custom object.
The ObjectARX DLL defining the rxClassName custom class must be loaded. Use the LoadARX method on the Application object to explicitly load the ObjectARX file.
VBA:
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")) )