How read lisp variable (point) in vb.net ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello there. I found below lisp in internet. What is does is , It will find the bounding box of selected object and it put those data in minpoint and maxpoint variable and show them in command prompt.
with this format ( x1 y1 z1 , x2 y2 z2)
I believe , right term is " Buffer ".
Now my question is , how can I can read X,Y
coordinates of those point in vb net.
Or at least write them in a file.
I nice example would be helpful because I am not a pro.
Thanks for all help.
;;=============================
(defun C:minmax()
(setq BarEname (cdr (car (entget (car (entsel "\nselect your object "))))))
(ucs-bbox BarEname)
)
;; can be used with vla-transformby to
;; transform objects from the UCS to the WCS
(defun UCS2WCSMatrix ()
(vlax-tmatrix
(append
(mapcar '(lambda (vector origin) (append (trans vector 1 0 t) (list origin)) )
(list '(1 0 0) '(0 1 0) '(0 0 1))
(trans '(0 0 0) 0 1) )
(list '(0 0 0 1))
)
)
)
;; transform objects from the WCS to the UCS
(defun WCS2UCSMatrix ()
(vlax-tmatrix
(append
(mapcar '(lambda (vector origin)(append (trans vector 0 1 t) (list origin)))
(list '(1 0 0) '(0 1 0) '(0 0 1))
(trans '(0 0 0) 1 0)
)
(list '(0 0 0 1))
)
)
)
;; Returns the UCS coordinates of the object bounding box about UCS
;; Argument
;; obj : a graphical object (ename or vla-object)
;; Return
;; a list of left lower point and right upper point UCS coordinates
(defun ucs-bbox (obj / minpoint maxpoint)
(vl-load-com)
(and (= (type obj) 'ENAME)
(setq obj (vlax-ename->vla-object obj))
)
(vla-TransformBy obj (UCS2WCSMatrix))
(vla-getboundingbox obj 'minpoint 'maxpoint)
(vla-TransformBy obj (WCS2UCSMatrix))
(list (vlax-safearray->list minpoint)
(vlax-safearray->list maxpoint)
)
)