Jump to content

Recommended Posts

Posted

I am not on Windows 8 but windows 7. Sadly I am unable to upload my drawing as for some reason I cannot! Could it not be to do with the fact that I am on AutoCAD 2014?

  • Replies 26
  • Created
  • Last Reply

Top Posters In This Topic

  • ymg3

    13

  • churchntj

    12

  • BIGAL

    1

  • Bhull1985

    1

Top Posters In This Topic

Posted Images

Posted

churchntj,

 

Kerry ran it for me on Autocad 2014 and report that it went well.

 

So check your Express Tools Installation. Make sure that the path

to express tools is present in OPTIONS -FiLE - Support File Search Path

 

ymg

Posted

Ok well for now it just doesn't seem to be working for arcs but it is working for spline and polyline which is great. No worries.

Just a random one: Do you have a LISP knocking about that will place a point at the extremities of a polyline all polylines selected?

Posted

churchntj,

 

Transform your arc into a polyline with command PEDIT.

 

For your points at both ends:

 

(setq en (car(entsel)))
(setq sp (vlax-curve-getstartpoint en)
     ep (vlax-curve-getendpoint en)
)      
(entmakex (list '(0 . "POINT") (cons 10 sp)))
(entmakex (list '(0 . "POINT") (cons 10 ep)))	

 

ymg

Posted

Any chance you could complete the code as I can't seem to make it work and don't have a lot of LISP writing experience

churchntj

Posted

The first code now work. Thanks

Posted

This will add 2 points at the extremity of the two polylines

and then proceed to join all the points.

 

(defun c:joinpt (/  en1 en2 enl1 enl2 flt lst1 lst2 ep sp)



  ;;*************************************************************************;
  ;; getfencesel        by ymg                                               ;
  ;;                                                                         ;
  ;; Arguments:  en,  Linear Entity Name (Polylines, Arc, Ellipse etc.)      ;
  ;;            flt,  A valid Entity filer Ex: '((0 . "3DFACE"))  or nil     ;
  ;;                                                                         ;
  ;;   Returns: A Selection Set of Entities touching the selecting entity.   ;
  ;;                                                                         ;
  ;;  Requires: Express Tools                                                ;
  ;;*************************************************************************;

  (defun getfencesel (en flt / fe px ss)    
     (acet-ss-zoom-extents (setq ss (ssadd en)))
     (setq px (* 0.75 (acet-geom-pixel-unit))
           fe (acet-list-remove-adjacent-dups (acet-geom-object-point-list en (/ px 2.0)))
           ss (if flt (ssget "_F" fe flt) (ssget "_F" fe))
     )      
  )

  ;;*************************************************************************;
  ;; mk_lwp    by Alan J Thompson                                            ;
  ;; Argument: pl, A list of points (2d or 3d)                               ;
  ;; Create an LWPolyline at Elevation 0, on Current Layer.                  ;
  ;; Return: Polyline Object                                                 ;
  ;;*************************************************************************;

  (defun mk_lwp (pl)
     (vlax-ename->vla-object
        (entmakex
          (append (list '(0 . "LWPOLYLINE")
                        '(100 . "AcDbEntity")
                        '(100 . "AcDbPolyline")
                         (cons 90 (length pl))
                        '(70 . 0)
                  )
                  (mapcar '(lambda (p) (cons 10 (trans (list (car p) (cadr p)) 1 0))) pl)
          )
       )
     )
  )

  (setq en1 (car (entsel "\nSelect First Polyline: "))
 en2 (car (entsel "\nSelect Second Polyline: "))
  sp (vlax-curve-getstartpoint en1)
         ep (vlax-curve-getendpoint en1)
  )
  (entmakex (list '(0 . "POINT") (cons 10 sp)))
  (entmakex (list '(0 . "POINT") (cons 10 ep)))
  (setq sp (vlax-curve-getstartpoint en2)
        ep (vlax-curve-getendpoint en2)
  )
  (entmakex (list '(0 . "POINT") (cons 10 sp)))
  (entmakex (list '(0 . "POINT") (cons 10 ep)))
 
  (setq flt '((0 . "POINT"))
       enl1 (acet-ss-to-list (getfencesel en1 flt))
enl2 (acet-ss-to-list (getfencesel en2 flt))
 
  )
  (setq lst1 nil lst2 nil)
 
  (foreach e enl1
     (setq lst1 (cons (cdr (assoc 10 (entget e))) lst1))
  )	    
  (foreach e enl2
     (setq lst2 (cons (cdr (assoc 10 (entget e))) lst2))
  )
  (mapcar '(lambda (a b) (mk_lwp (list a b))) lst1 lst2)
  (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...