Hi.
I could have figure this one out if its in autolisp.
This lisp was from Tim Wiley which find a piece of string then zoom to it.
Is anyone able to modify this lisp to drawing a LINE from 0,0 to the object instead of zooming into object.
I tried (setq ObjOrigin (vla-get-Origin Obj)) and it doesn't work.
(defun c:Test (/ Str ObjType)
(vl-load-com)
(defun ZoomTo (Obj)
(command "_.zoom" "_object" (vlax-vla-object->ename Obj) "")
(while (/= (getstring "\n Press enter to proceed to next object: ") ""))
)
;--------------------------------------------
(if (/= (setq Str (getstring "\n Enter text to find: ")) "")
(vlax-for Obj (vla-get-Block (vla-get-ActiveLayout (vla-get-ActiveDocument
(vlax-get-Acad-Object))))
(setq ObjType (vla-get-ObjectName Obj))
(cond
((and (or (= ObjType "AcDbText") (= ObjType "AcDbMText")) (= Str
(vla-get-TextString Obj)))
(ZoomTo Obj)
)
((= ObjType "AcDbBlockReference")
(foreach Att (vlax-invoke Obj 'GetAttributes)
(if (= (vla-get-TextString Att) Str)
(ZoomTo Att)
)
)
)
)
)
)
(princ)
)
Thankyou and happy new year.