Jump to content

Drawing cylindrical break line ?


liuhaixin88

Recommended Posts

After adding the two slide images go back to Autocad and copy and paste the following into your command line and let me know the outcome .

 

(findfile "Round DisConnection.sld")

Or this .

 

(findfile "Cut DisConnection.sld")

 

(findfile "Round DisConnection.sld") "E:\\program files\\autocad

2010\\support\\Round DisConnection.sld"

 

(findfile "Round DisConnection.sld") "E:\\program files\\autocad

2010\\support\\Round DisConnection.sld"

Link to comment
Share on other sites

  • Replies 48
  • Created
  • Last Reply

Top Posters In This Topic

  • liuhaixin88

    21

  • Tharwat

    16

  • ReMark

    4

  • highflybird

    4

Top Posters In This Topic

Posted Images

That is good so far and nothing is wrong .

 

How did you run the vlx file ?

 

(findfile "PDC.VLX")
"E:\\program files\\autocad 2010\\support\\PDC.VLX"

appload-----pdc.vlx,

command: pdc

 

Warning -----Cna't run the code ..................

Link to comment
Share on other sites

The problem may lay in the language of your PC , anyway load this function and let me know the outcome .

 

(defun PathOfSupportFolder (/ cad p l)
   (setq cad (getenv "ACAD"))
   (while (setq p (vl-string-search ";" cad))
     (setq l   (cons (substr cad 1 p) l)
           cad (substr cad (+ 2 p))
     )
   )
   (if l
     (nth 1 (reverse l))
   )
 )

(PathOfSupportFolder)

Link to comment
Share on other sites

The problem may lay in the language of your PC , anyway load this function and let me know the outcome .

 

(defun PathOfSupportFolder (/ cad p l)
   (setq cad (getenv "ACAD"))
   (while (setq p (vl-string-search ";" cad))
     (setq l   (cons (substr cad 1 p) l)
           cad (substr cad (+ 2 p))
     )
   )
   (if l
     (nth 1 (reverse l))
   )
 )

(PathOfSupportFolder)

 

Y,language is chinese.

 

(PathOfSupportFolder) "D:\\Documents and Settings\\liuhaixin\\application 
data\\autodesk\\autocad 2010\\r18.0\\chs\\support"

Link to comment
Share on other sites

So add the two slide images in that folder and not in the one that you have posted in earlier before ;)

You mean: add two slide images in ""D:\\Documents and Settings\\liuhaixin\\application

data\\autodesk\\autocad 2010\\r18.0\\chs\\support" ?

Link to comment
Share on other sites

So add the two slide images in that folder and not in the one that you have posted in earlier before ;)

 

OK! NOW IS OK! Thanks!

Link to comment
Share on other sites

You mean: add two slide images in ""D:\\Documents and Settings\\liuhaixin\\application

data\\autodesk\\autocad 2010\\r18.0\\chs\\support" ?

 

Yes , and let me know .

Link to comment
Share on other sites

:D

 

Excellent , enjoy it .

 

This should be your early works .

 

Thanks Tharwat, but how to do thiis ,my Thread. break in middle . (Maybe line or pline)

20140422153336.jpg

Link to comment
Share on other sites

You can only make some of the people happy some of the time but not all of the people happy all of the time.

 

Too esoteric.

Link to comment
Share on other sites

Try this routine that I just wrote for you purpose .

 

(defun c:test (/ pick p1 s1 p2 s2 p3 s3 p4 s4)
 ;;    Tharwat 24. Apr. 2014        ;;
 (defun pick (p / s)
   (if (not (setq s (ssget p '((0 . "LINE,LWPOLYLINE")))))
     (progn (princ "\n Should pick a point on Line or Polyline !") nil)
     t
   )
   s
 )
 (if (and (setq p1 (getpoint "\n Specify first point on [Line,Polyline] :"))
          (setq s1 (pick p1))
          (setq p2 (getpoint "\n Specify opposite point :" p1))
          (setq s2 (pick p2))
          (setq p3 (getpoint "\n Specify parallel point to first point :"))
          (if (and (setq p4 (polar p3 (angle p2 p1) (distance p2 p1)))
                   (setq s4 (pick p4))
                   (equal (cdr (assoc -1 (entget (ssname s1 0)))) (cdr (assoc -1 (entget (ssname s4 0)))))
              )
            t
            (progn (princ "\n No line found in Point number Four !") nil)
          )
          (if (and (setq s3 (pick p3))
                   (equal (cdr (assoc -1 (entget (ssname s2 0)))) (cdr (assoc -1 (entget (ssname s3 0)))))
              )
            t
            (progn (princ "\n Second and third point must be picked on the same Line or Polyline !") nil)
          )
     )
   (progn (defun Breakline (p1 p2 / a d f g h j k i p3)
            (setq d (distance p1 p2)
                  a (angle p1 p2)
                  f (polar p1 (+ pi a) (* 0.5 d))
                  g (polar p1 a (- (* 0.5 d) (* 0.25 d)))
                  h (polar g (- a (* pi 0.5)) (* 0.25 d))
                  k (polar p2 a (* 0.5 d))
                  j (polar p2 (+ pi a) (* 0.25 d))
                  i (polar j (- a (* 1.5 pi)) (* 0.25 d))
            )
            (entmake (list '(0 . "LWPOLYLINE")
                           '(100 . "AcDbEntity")
                           '(100 . "AcDbPolyline")
                           '(90 . 4)
                           '(70 . 0)
                           '(43 . 0.0)
                           (cons 10 (list (car p1) (cadr p1)))
                           '(40 . 0.0)
                           '(41 . 0.0)
                           '(42 . -0.414214)
                           (setq p3 (cons 10 (mapcar '(lambda (x y) (/ (+ x y) 2.)) p1 p2)))
                           '(40 . 0.0)
                           '(41 . 0.0)
                           '(42 . 0.498582)
                           (cons 10 (list (car p2) (cadr p2)))
                           '(40 . 0.0)
                           '(41 . 0.0)
                           '(42 . 0.498582)
                           p3
                           '(40 . 0.0)
                           '(41 . 0.0)
                           '(42 . -0.498582)
                     )
            )
          )
          (if (and (Breakline p1 p2) (Breakline p3 p4))
            (foreach x (list (list s1 p1 p4) (list s2 p2 p3))
              (vl-cmdf "_.break" (car x) "_F" "_non" (cadr x) "_non" (caddr x))
            )
          )
   )
 )
 (princ)
)

Edited by Tharwat
Link to comment
Share on other sites

Try this routine that I just wrote for you purpose .

 

(defun c:test (/ pick p1 s1 p2 s2 p3 s3 p4 s4)
 ;;    Tharwat 24. Apr. 2014        ;;
 (defun pick (p / s)
   (if (not (setq s (ssget p '((0 . "LINE,LWPOLYLINE")))))
     (progn (princ "\n Should pick a point on Line or Polyline !") nil)
     t
   )
   s
 )
 (if (and (setq p1 (getpoint "\n Specify first point on [Line,Polyline] :"))
          (setq s1 (pick p1))
          (setq p2 (getpoint "\n Specify opposite point :" p1))
          (setq s2 (pick p2))
          (setq p3 (getpoint "\n Specify parallel point to first point :"))
          (if (and (setq p4 (list (car p3) (cadr p1) 0.))
                   (setq s4 (pick p4))
                   (equal (cdr (assoc -1 (entget (ssname s1 0)))) (cdr (assoc -1 (entget (ssname s4 0)))))
              )
            t
            (progn (princ "\n No line found in Point number Four !") nil)
          )
          (if (and (setq s3 (pick p3))
                   (equal (cdr (assoc -1 (entget (ssname s2 0)))) (cdr (assoc -1 (entget (ssname s3 0)))))
              )
            t
            (progn (princ "\n Second and third point must be picked on the same Line or Polyline !") nil)
          )
     )
   (progn (defun Breakline (p1 p2 / a d f g h j k i p3)
            (setq d (distance p1 p2)
                  a (angle p1 p2)
                  f (polar p1 (+ pi a) (* 0.5 d))
                  g (polar p1 a (- (* 0.5 d) (* 0.25 d)))
                  h (polar g (- a (* pi 0.5)) (* 0.25 d))
                  k (polar p2 a (* 0.5 d))
                  j (polar p2 (+ pi a) (* 0.25 d))
                  i (polar j (- a (* 1.5 pi)) (* 0.25 d))
            )
            (entmake (list '(0 . "LWPOLYLINE")
                           '(100 . "AcDbEntity")
                           '(100 . "AcDbPolyline")
                           '(90 . 4)
                           '(70 . 0)
                           '(43 . 0.0)
                           (cons 10 (list (car p1) (cadr p1)))
                           '(40 . 0.0)
                           '(41 . 0.0)
                           '(42 . -0.414214)
                           (setq p3 (cons 10 (mapcar '(lambda (x y) (/ (+ x y) 2.)) p1 p2)))
                           '(40 . 0.0)
                           '(41 . 0.0)
                           '(42 . 0.498582)
                           (cons 10 (list (car p2) (cadr p2)))
                           '(40 . 0.0)
                           '(41 . 0.0)
                           '(42 . 0.498582)
                           p3
                           '(40 . 0.0)
                           '(41 . 0.0)
                           '(42 . -0.498582)
                     )
            )
          )
          (if (and (Breakline p1 p2) (Breakline p3 p4))
            (foreach x (list (list s1 p1 p4) (list s2 p2 p3))
              (vl-cmdf "_.break" (car x) "_F" "_non" (cadr x) "_non" (caddr x))
            )
          )
   )
 )
 (princ)
)

 

Thank you very much! Tharwat, You are my god!

 

I do not know how grateful you, you help me too much! :beer:

Link to comment
Share on other sites

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