Jump to content

Recommended Posts

Posted

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.

Posted
Just like that Alan, you know.

Oh, of course. How could I have been so stupid? LoL

Posted
Oh, of course. How could I have been so stupid? LoL

 

alan you feel this XL line to PL line is stupid question?

Posted
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?

Posted

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....

Posted

while placng its directly place PL.....format..thats it.i think alan now understand

Posted

I don't understand. What's the point of using a fixed length on an XL?

Posted
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.

Posted

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.

Posted

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)
)

Posted

Politics is pointless. This is just a step above. LOL

Posted

i have chekd its not working fine.we cannt able to place directly PL???

Posted
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?

Posted

If you make two separate breaks in an Xline or Ray, the middle piece turns into a Line :)

Posted

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)
)

Posted
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?

Posted

??

 

(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)
)

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...