vernonlee 发表于 2022-7-5 18:45:42

帮助:LISP以分离/修剪/sp

目前,我的工作涉及根据图中所示改变切割线内外项目的颜色。
 
目前我使用trim命令&这需要很长时间&我有很多这样的实例。
 
有没有Lisp程序的语言可以更快?
 
谢谢
 
切割。图纸

BIGAL 发表于 2022-7-5 19:18:51

库克卡特。lsp?
 
第二步修剪图案填充cookiecutter在dwg中删除。
 
想到的唯一一件事是偏移pline边界,获取顶点并使用“F”围栏选项,然后四处走动。这相当于一次只做一段。需要测试时间。

vernonlee 发表于 2022-7-5 19:41:05

 
尝试cookiecutter 1.2。
1) 如果我不破坏图案填充,修剪的结果会更好。
2) 但只能使用1个尖端,在我的例子中有2个。
3) 由于第二,我将削减3次,将需要创建重复的文件,因为任何内部或外部我想保留将被删除。
4) 如果我为删除选项选择“否”,它仍将删除,但修剪的结果不符合剪切线。不确定“不”实际上是什么意思。
 
我不得不说,虽然我必须创建图纸的副本并将其组合在一起,但我认为这个LISP可能是我最接近和最好的选择。
 
谢谢BIGAL

BIGAL 发表于 2022-7-5 19:58:39

方法是取外点线偏移1个单位,然后得到所有顶点,这在“修剪栅栏”中使用,我认为这会起作用,然后对内点线重复两次拾取,但仍然很快。只是需要一些时间。其他人以前也可能有。
一个正在进行的工作,它不工作,但我知道方法是这样做,因为我已经做了这一点,这是一位代码,我没有更多。
; pline co-ords example
; By Alan H
(defun getcoords (ent)
(vlax-safearray->list
   (vlax-variant-value
   (vlax-get-property
   (vlax-ename->vla-object ent)
   "Coordinates"
   )
   )
)
)

(defun co-ords2xy ()
; convert now to a list of xy as co-ords are x y x y x y if 3d x y z x y z
(setq len (length co-ords))
(setq numb (/ len 2)) ; even and odd check required
(setq I 0)
(repeat numb
(setq xy (list (nth i co-ords)(nth (+ I 1) co-ords) ))
; odd (setq xy (list (nth i co-ords)(nth (+ I 1) co-ords)(nth (+ I 2) co-ords) ))
(setq co-ordsxy (cons xy co-ordsxy))
(setq I (+ I 2))
)
)

; program starts here
(defun c:trmmer ( / co-ordsxy)
(setq co-ords (getcoords (car (entsel "\nplease pick pline")))) ; chnage to offset one unit
(co-ords2xy) ; list of 2d points making pline

; need to get this to work
(command "trim" obj "" F co-ordsxy)
)

页: [1]
查看完整版本: 帮助:LISP以分离/修剪/sp