0 Members and 1 Guest are viewing this topic.
(defun ARCH:MsgBox2 (title buttons message time / return WshShell) (setq WshShell (vlax-create-object "WScript.Shell")) (setq return (vlax-invoke WshShell 'Popup message time title (itoa buttons))) (vlax-release-object WshShell) return);;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Here is a little example of storing x-data data ActiveX;;;You have to get used to variants and safearrays to do it.;;;Peter Jamtgaard(defun GET-XDATA-DRWDWLVR (/ ENAM EOBJ XDTYPE XDVALUE) (vl-load-com) (setq ENAM (cdar OBJX) EOBJ (vlax-ename->vla-object ENAM)) (vla-getXData EOBJ "DRWDWLVR" 'XDTYPE 'XDVALUE) (mapcar '(lambda (X Y) (cons X (variant-value Y))) (vlax-safearray->list XDTYPE) (vlax-safearray->list XDVALUE)));;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;(defun C:TAG () (setq scf (getvar "dimscale")) (setvar "cmdecho" 0) (setq objx (entget (car (entsel "\n* Select Door Wdw to Tag *")))) ;;(if (= objx nil)(setq objx (entget (entlast)))) (setq xdli (cdr (assoc 2 (entget (cdar objx) '("DRWDWLVR"))))) (setq xszx (substr xdli 5 (- (strlen xdli) 8))) (setq insx (cdr (assoc 10 objx))) ;;(setq insx (getpoint "\n* Pick Tag point...")) (setq angx (distof (princ (cdr (cadr (GET-XDATA-DRWDWLVR)))) 2)) (setq xdrx (substr xdli 1 (- (strlen xdli) 6))) (setq xwdx (substr xdli 1 (- (strlen xdli) 6))) (setq xlvx (substr xdli 1 (- (strlen xdli) 6))) (setq xdr9 (substr xdli 1 (- (strlen xdli) 9))) (setq xwd9 (substr xdli 1 (- (strlen xdli) 9))) (setq xlv9 (substr xdli 1 (- (strlen xdli) 9))) (if (= M nil) (setq M 1)) (setq nam1 (vl-list->string (vl-remove-if-not '(lambda (x) (< 47 x 58)) (vl-string->list (rtos (atoi xszx) 4 0))))) (setq nam2 (substr xdli 5 (- (strlen xdli) 8))) (setq nam3 (vl-list->string (vl-remove-if-not '(lambda (x) (< 47 x 58)) (vl-string->list (rtos (/ (atoi nam2) 2) 4 0))))) (setq nam4 (vl-list->string (vl-remove-if-not '(lambda (x) (< 47 x 58)) (vl-string->list (rtos (/ (atoi nam2) M) 4 0)))))(ARCH:MsgBox2 " Arch2Program© : Message" 64 (strcat "\n DrWdwLvr Tag Settings" "\n---------------------------------------------------------------------------" "\n Full Name:\t " xdli "\n Tag Type:\t " (substr xdli 1 (- (strlen xdli) 6)) "\n Tag Size:\t " xszx "\n Insert X:\t " (rtos (car insx) 2 2) "\n Insert Y:\t " (rtos (cadr insx) 2 2) "\n Angle:\t " (rtos angx 2 6) ) 4) )
;;;Here is a little example of storing x-data data ActiveX;;;You have to get used to variants and safearrays to do it.;;;Peter Jamtgaard(defun ADD-XDATA-DRWDWLVR (/ ENAM EOBJ STR) (vl-load-com) (regapp "DRWDWLVR") (setq ENAM (cdar (entget (entlast))) EOBJ (vlax-ename->vla-object ENAM) STR (rtos ARCH#ANGL 2 8)) (vla-setxdata EOBJ (vlax-make-variant (vlax-safearray-fill (vlax-make-safearray vlax-vbInteger '(0 . 1)) '(1001 1000))) (vlax-make-variant (vlax-safearray-fill (vlax-make-safearray vlax-vbVariant '(0 . 1)) (list "DRWDWLVR" STR)))) (prin1))