- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I've been working on a LISP for a week or so and I'm nearly there but can;t seem to finish it.
I'm trying to make a script for drawing duct work. Basically it goes Select Line>Specify duct diameter>change colour to 1 (red) and line type>fillet by diameter>double offset>change new offset lines to colour 2 (yellow) and line type to continuous.
I've done all but the final step and can't work out what I'm missing.
Here's my script so far:
(defun C:ee(/ ent ep num1 num2 obj obj1 obj2 of pte pts sp)
(or (vl-load-com))
(if (setq ent (entsel))
(progn
(setq of1 (getdist "\n Specify duct diameter: ")
of (/ of1 2))
(command "fillet" "r" of1 "fillet" "p" ent "" )
(command "chprop" ent "" "c" "1" "lt" "CENTER2" "")
(setq obj (vlax-ename->vla-object (car ent)))
(setq num1 0
num2 (1- (/ (length (vlax-get obj 'Coordinates)) 2))
)
(setq sp (vlax-curve-getstartpoint obj)
ep (vlax-curve-getendpoint obj)
)
(setq obj1 (vlax-invoke obj 'Offset of))
(setq obj2 (vlax-invoke obj 'Offset (* -1 of)))
(setq pts
(vlax-safearray-fill
(vlax-make-safearray vlax-vbdouble '(1 . 1))
(list (car sp)(cadr sp)))
pte
(vlax-safearray-fill
(vlax-make-safearray vlax-vbdouble '(1 . 1))
(list (car ep)(cadr ep))))
(vla-put-coordinate (car obj1) num1 pts)
(vla-put-coordinate (car obj2) num1 pts)
(vla-put-coordinate (car obj1) num2 pte)
(vla-put-coordinate (car obj2) num2 pte)
)
)
(princ)
)
Any thoughts?
Solved! Go to Solution.