johnpieter Posted December 19, 2010 Posted December 19, 2010 now i am placing xl line! that entity is xl line.Now how to place xl line with polyline or line format.while placing xl line its direct place to polyline or line format. Quote
alanjt Posted December 20, 2010 Posted December 20, 2010 Just like that Alan, you know. Oh, of course. How could I have been so stupid? LoL Quote
johnpieter Posted December 20, 2010 Author Posted December 20, 2010 Oh, of course. How could I have been so stupid? LoL alan you feel this XL line to PL line is stupid question? Quote
alanjt Posted December 20, 2010 Posted December 20, 2010 alan you feel this XL line to PL line is stupid question? Not at all what I'm saying. I couldn't understand the question, to begin with. Is that what you after, converting an XLine to a PLine? If so, how are you to determine the start and end point, since an XLine is infinite? Quote
johnpieter Posted December 20, 2010 Author Posted December 20, 2010 ok Alan.from the selection point can you fix some distance.total pl length 10000 is enough.Same XL line Horizantal and Vertical option is enoughJust directly its place 10000 lengh is ok.... Quote
johnpieter Posted December 20, 2010 Author Posted December 20, 2010 while placng its directly place PL.....format..thats it.i think alan now understand Quote
ReMark Posted December 20, 2010 Posted December 20, 2010 I don't understand. What's the point of using a fixed length on an XL? Quote
alanjt Posted December 20, 2010 Posted December 20, 2010 I don't understand. What's the point of using a fixed length on an XL? While this is completely doable, I was wondering the same thing. Quote
johnpieter Posted December 20, 2010 Author Posted December 20, 2010 no....actually we are using XL for reference.we cannt access the XL line frequently.PL means we can use frequently.so only expect some what length. Quote
Lee Mac Posted December 20, 2010 Posted December 20, 2010 Seems pointless, but you may learn something from this perhaps... (defun c:xl2l ( / xl pt ln ) (if (and ;; Prompt for selection of XLine (setq xl (car (entsel "\nSelect XLine: "))) ;; Check that it is indeed an XLine (eq "XLINE" (cdr (assoc 0 (entget xl)))) ;; Prompt for selection of point on XLine (setq pt (getpoint "\nPick Base Point on XLine: ")) ;; Make sure the point is on the XLine (setq pt (vlax-curve-getClosestPointto xl (trans pt 1 0))) ;; Prompt for Length of Resultant Line (setq ln (getdist "\nLength of Line: " (trans pt 0 1))) ;; All conditions met, good to go... ) ;; Make the Line (entmake (list (cons 0 "LINE") (cons 10 pt) ;; Start Point (cons 11 ;; Defined from the Start Point (polar pt ;; at the Angle of the direction vector of XLine (angle '(0. 0. 0.) (cdr (assoc 11 (entget xl)))) ;; with the Length as specified ln ) ) ) ) ) (princ) ) Quote
ReMark Posted December 20, 2010 Posted December 20, 2010 Politics is pointless. This is just a step above. LOL Quote
johnpieter Posted December 20, 2010 Author Posted December 20, 2010 i have chekd its not working fine.we cannt able to place directly PL??? Quote
ReMark Posted December 20, 2010 Posted December 20, 2010 i have chekd its not working fine.we cannt able to place directly PL??? You want a polyline drawn on top of the XLine so you can somehow reference it? Quote
eldon Posted December 20, 2010 Posted December 20, 2010 If you make two separate breaks in an Xline or Ray, the middle piece turns into a Line Quote
alanjt Posted December 20, 2010 Posted December 20, 2010 Coded it earlier, but had a phone call... (defun c:X2L (/ ss) ;; Alan J. Thompson, 12.20.10 (vl-load-com) (if (setq ss (ssget "_:L" '((0 . "XLINE")))) ((lambda (i / e) (while (setq e (ssname ss (setq i (1+ i)))) (and (entmake (append '((0 . "LINE")) (vl-remove-if (function (lambda (x) (vl-position (car x) '(-1 0 5 10 100)))) (entget e) ) (mapcar (function (lambda (p d) (cons p (vlax-curve-getPointAtDist e d)))) '(10 11) '(10000. -10000.) ) ) ) (entdel e) ) ) ) -1 ) ) (princ) ) Quote
johnpieter Posted December 21, 2010 Author Posted December 21, 2010 Coded it earlier, but had a phone call... (defun c:X2L (/ ss) ;; Alan J. Thompson, 12.20.10 (vl-load-com) (if (setq ss (ssget "_:L" '((0 . "XLINE")))) ((lambda (i / e) (while (setq e (ssname ss (setq i (1+ i)))) (and (entmake (append '((0 . "LINE")) (vl-remove-if (function (lambda (x) (vl-position (car x) '(-1 0 5 10 100)))) (entget e) ) (mapcar (function (lambda (p d) (cons p (vlax-curve-getPointAtDist e d)))) '(10 11) '(10000. -10000.) ) ) ) (entdel e) ) ) ) -1 ) ) (princ) ) alan this is really good...with out xl line place we cannt able to place this line format directly? Quote
alanjt Posted December 21, 2010 Posted December 21, 2010 ?? (defun c:PXL (/ pnt ang) ;; Alan J. Thompson, 12.21.10 (if (and (setq pnt (getpoint "\nSpecify a point: ")) (setq ang (getangle pnt "\nSpecify through point or angle: ")) ) ((lambda (ang pnt) (entmake (cons '(0 . "LINE") (mapcar (function (lambda (p a) (cons p (polar pnt a 10000.)))) '(10 11) (list (+ ang pi) ang) ) ) ) ) (if (zerop (getvar 'worlducs)) (+ ang (angle '(0. 0. 0.) (trans (getvar 'UCSXDIR) 0 (trans '(0. 0. 1.) 1 0 T) T))) ang ) (trans pnt 1 0) ) ) (princ) ) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.