Message 1 of 9
Xline creating issue...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I try to divide POLYLINEs, LINEs, CIRCLEs, ELLIPSEs, SPLINEs and ARCs according to light poles distribution purposes. It's become possible if I draw dividing line (see my modification of Tharwat code)
;;; Divide POLYLINEs,LINEs,CIRCLEs,ELLIPSEs,SPLINEs and ARCs according to light poles distribution purposes ;;; Modified by Igal Averbuh 2018 (added optilon x/2 x x x/2 divide for lighting purposes) ;;; Created by ;;; Tharwat 02. Jan. 2013 ;;; ;;; Saved from: https://www.cadtutor.net/forum/topic/43505-help-modifying-a-modified-divide-lisp-from-cadalyst-website/ (defun c:AD (/ s n j sn d i l pt ang) (vl-load-com) (if (and (setq n (getint "\n Number of segments :")) (setq s (ssget '((0 . "*POLYLINE,LINE,CIRCLE,ELLIPSE,SPLINE,ARC")))) ) (if (not (eq n 0)) (repeat (setq j (sslength s)) (setq sn (ssname s (setq j (1- j)))) (setq d (/ (vlax-curve-getdistatparam sn (vlax-curve-getendparam sn)) n) i (* d 0.5) l (/ d 10.) ) (repeat n (setq pt (vlax-curve-getpointatdist sn i)) (setq ang (angle '(0.0 0.0 0.0) (vlax-curve-getfirstderiv sn (vlax-curve-getparamatpoint sn pt)))) (entmake (list '(0 . "XLINE") '(100 . "AcDbEntity") '(100 . "AcDbXline") (cons 10 (polar pt (+ ang (/ pi 2.)) l)) (cons 11 (polar pt (- ang (/ pi 2.)) l)) ) ) ;(entmakex (list '(0 . "LINE") ;(cons 10 (polar pt (+ ang (/ pi 2.)) l)) ;(cons 11 (polar pt (- ang (/ pi 2.)) l)) ;) ;) ;(command "_.XLINE" "_B") (setq i (+ d i)) ) ) (alert "Number of segments must be bigger than ZERO !!") ) ) (princ) ) (c:ad)
I did another step and now I need to divide it by xlines
It become possible if I use (command "_.XLINE" "_B")
when starting and direction vector points are:
(cons 10 (polar pt (+ ang (/ pi 2.)) l))
(cons 11 (polar pt (- ang (/ pi 2.)) l))
.. but my attempt to add it to lisp was unsuccessful
can somebody help me to do it?
The main goal is - to create xlines in division points..
Any help will be very appreciated