Author Topic: how to pass point list to command line ?  (Read 1210 times)

0 Members and 1 Guest are viewing this topic.

CatDance

  • Newt
  • Posts: 57
how to pass point list to command line ?
« 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 ?
« Last Edit: August 22, 2021, 04:35:09 AM by CatDance »
A must-read book: Amazing story how Bill + Paul started Microsoft and history of computer revolution.
https://www.amazon.com/Hard-Drive-Making-Microsoft-Empire/dp/0887306292

Brief history of Microsoft
https://www.youtube.com/watch?v=BLaMbaVT22E

Crank

  • Water Moccasin
  • Posts: 1503
Re: how to pass point list to command line ?
« Reply #1 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).
Vault Professional 2023     +     AEC Collection

BIGAL

  • Swamp Rat
  • Posts: 1409
  • 40 + years of using Autocad
Re: how to pass point list to command line ?
« Reply #2 on: August 22, 2021, 09:36:32 PM »
If you look closely clipit makes a polygon boundary.
A man who never made a mistake never made anything