TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: CatDance on August 22, 2021, 04:25:28 AM

Title: how to pass point list to command line ?
Post by: CatDance on August 22, 2021, 04:25:28 AM
Code - Auto/Visual Lisp: [Select]
  1. (defun c:cbf ()          
  2.  
  3.   (setq ino 0)
  4.   (while (setq ssg (ssget))
  5.     (repeat (sslength ssg)
  6.       (setq eg (entget (ssname ssg ino)))
  7.       (if (= (cdr (assoc 0 eg)) "CIRCLE") (setq CrPxy (cdr (assoc 10 eg))))     ;circle center pt
  8.       (if (= (cdr (assoc 0 eg)) "IMAGE") (setq iEn (cdr (assoc -1 eg))))        ;image ename for clipping
  9.       (setq ino (1+ ino))
  10.     )
  11.     (setq ang 0 cPtLt nil)
  12.     (while (< ang 360)
  13.       (setq cPtLt (append cPtLt (list (polar CrPxy (d2r ang) 68))))
  14.       (setq ang (+ ang 5))
  15.     )
  16.     (command "imageclip" iEn "n" "p" cPtLt)
  17.   )
  18.  
  19.  
  20. )
  21.  
  22.  
  23.  

I am trying to clip a square image (jpeg image) into a circular shape.
It did not clip the image and just exited the command line.
How to pass a point list to the command line ?
Title: Re: how to pass point list to command line ?
Post by: Crank on August 22, 2021, 07:44:43 AM
Perhaps the IMAGECLIP command only accepts 2d points (didn't try). But you need to close the command with "" [enter].

My advise:
If you're using a MAC, first draw a clipping boundary with the POLYGON command and then use IMAGECLIP.
If you're using Windows: Try the CLIPIT command (from express tools).
Title: Re: how to pass point list to command line ?
Post by: BIGAL on August 22, 2021, 09:36:32 PM
If you look closely clipit makes a polygon boundary.