Message 1 of 2
Emulating fence (as in selection)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to emulate the behavior and appearance of the fence option as in selecting objects, while at the same time creating a polyline for my TrimDim routine.
Here's what mostly works, but I forget how to make a rubberband vector look highlighted.
Is there some sysvar?
(defun c:fence ( / Mspace getp 2d p plist obj) (setq Mspace (vlax-get (vlax-get (vlax-get-acad-object) 'Activedocument) 'Modelspace)) (defun getp (p) (if p (getpoint p "\nNext fence point: ") (getpoint "\nFirst fence point: ") ) ) (defun 2d (p)(list (car p)(cadr p))) (while (setq p (getp p)) (setq plist (reverse (cons (2d p) (reverse plist)))) (cond ((< (length plist) 2)) ((= (length plist) 2) (setq obj (vlax-invoke Mspace 'AddLightweightPolyline (apply 'append plist))) (vla-highlight obj 1) ) (obj (vlax-put obj 'coordinates (apply 'append plist)) (vla-highlight obj 1) ) ((princ "\nSomething is awry.")) ) ) (princ) )
John F. Uhden